Skip to content

Commit da2a824

Browse files
committed
Upgrade to php-parser 5.0
1 parent 46f8a39 commit da2a824

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"require": {
1515
"php": ">=8.0 <8.4",
16-
"nikic/php-parser": "^4.13"
16+
"nikic/php-parser": "^5.0"
1717
},
1818
"autoload": {
1919
"psr-4": {"PHPFUI\\PHPUnitSyntaxCoverage\\": "src/PHPFUI/PHPUnitSyntaxCoverage/"}

src/PHPFUI/PHPUnitSyntaxCoverage/ClassFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function enterNode(int|\PhpParser\Node|null $node)
2525
{
2626
if ($node instanceof \PhpParser\Node\Stmt\Namespace_)
2727
{
28-
$this->currentNamespace = \implode('\\', $node->name->parts);
28+
$this->currentNamespace = $node->name->name;
2929
}
3030
elseif ($node instanceof \PhpParser\Node\Stmt\Class_ && $node->name)
3131
{

src/PHPFUI/PHPUnitSyntaxCoverage/Extensions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Extensions extends \PHPUnit\Framework\TestCase
3535
public static function setUpBeforeClass() : void
3636
{
3737
$factory = new \PhpParser\ParserFactory();
38-
self::$parser = $factory->create($_ENV[self::class . '_parser_type'] ?? \PhpParser\ParserFactory::PREFER_PHP7);
38+
self::$parser = $factory->createForHostVersion();
3939
}
4040

4141
protected function setUp() : void

tests/UnitTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ public function testVendorDirectory() : void
4747
{
4848
$this->skipNamespaceTesting();
4949
// Sloppy coding from various packages causes us to have to skip directories. If only they used PHPUnitSyntaxCoverage they would have detected these issues!
50-
$this->addSkipDirectory('DependencyInjection'); // Symfony\Component\DependencyInjection
50+
$this->addSkipDirectory('DependencyInjection'); // these components don't work due to missing dependencies. Unbelievable for Symfony
51+
$this->addSkipDirectory('http-foundation');
52+
$this->addSkipDirectory('DataCollector');
5153
$this->assertValidPHPDirectory(__DIR__ . '/../vendor', 'Vendor directory is not valid');
5254
}
5355
}

0 commit comments

Comments
 (0)