Skip to content

Commit

Permalink
Configure GitHub action to e2e test both Nikic and PHPStan parsers.
Browse files Browse the repository at this point in the history
Resolve Psalm issues.
  • Loading branch information
patrickkusebauch committed Mar 30, 2024
1 parent dffb975 commit 1a76dab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
matrix:
os: [ubuntu-22.04]
php-version: [8.1, 8.2, 8.3]
phpstan_parser: [true, false]

steps:
- name: "Checkout"
Expand Down Expand Up @@ -108,5 +109,15 @@ jobs:
- name: "Install dependencies with composer"
run: make composer-install

- name: Configure PhpStan Parser in 'deptrac.yaml'
if: matrix.phpstan_parser == 'false'
run: |
sed -i 's/phpstan_parser: true/phpstan_parser: false/' deptrac.yaml
- name: Configure PhpStan Parser in 'deptrac.config.php'
if: matrix.phpstan_parser == 'false'
run: |
sed -i 's/phpstanParser: true/phpstanParser: false/' deptrac.config.php
- name: "Run deptrac"
run: make deptrac
5 changes: 4 additions & 1 deletion src/Core/Ast/Parser/DelegatingParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Qossmic\Deptrac\Core\Ast\Parser;

use PhpParser\NodeTraverser;
use Qossmic\Deptrac\Core\Ast\AstMap\File\FileReference;
use Qossmic\Deptrac\Core\Ast\Parser\NikicPhpParser\NikicPhpParser;
use Qossmic\Deptrac\Core\Ast\Parser\PhpStanParser\PhpStanParser;
Expand All @@ -17,7 +18,9 @@ public function __construct(
private readonly array $featureFlags,
private readonly NikicPhpParser $nikicPhpParser,
private readonly PhpStanParser $phpStanParser,
) {}
) {
$this->traverser = new NodeTraverser();
}

protected function loadNodesFromFile(string $filepath): array
{
Expand Down

0 comments on commit 1a76dab

Please sign in to comment.