Skip to content

Commit 0251dbb

Browse files
authored
Merge pull request #65 from TomasVotruba/tv-bump
add patch to php-parser to check for T_ token existance in older PHP versions
2 parents f615f2c + 74887e8 commit 0251dbb

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"require": {
1010
"php": ">=8.2",
11-
"illuminate/container": "^11.35",
11+
"illuminate/container": "^11.44",
1212
"nette/utils": "^4.0",
1313
"nikic/php-parser": "^5.4",
1414
"symfony/console": "^6.4",
@@ -17,12 +17,12 @@
1717
},
1818
"require-dev": {
1919
"phpstan/extension-installer": "^1.4",
20-
"phpstan/phpstan": "^2.0",
20+
"phpstan/phpstan": "^2.1",
2121
"phpunit/phpunit": "^11.5",
2222
"rector/rector": "^2.0",
23-
"symplify/easy-coding-standard": "^12.4",
23+
"phpecs/phpecs": "^2.1",
2424
"symplify/phpstan-extensions": "^12.0",
25-
"symplify/vendor-patches": "^11.3",
25+
"symplify/vendor-patches": "^11.4",
2626
"tomasvotruba/unused-public": "^2.0",
2727
"tracy/tracy": "^2.10"
2828
},
@@ -57,6 +57,9 @@
5757
},
5858
"extra": {
5959
"patches": {
60+
"nikic/php-parser": [
61+
"patches/nikic-php-parser-lib-phpparser-parserabstract-php.patch"
62+
],
6063
"symfony/console": [
6164
"patches/symfony-console-helper-helper-php.patch"
6265
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- /dev/null
2+
+++ ../lib/PhpParser/ParserAbstract.php
3+
@@ -1260,7 +1260,7 @@
4+
}
5+
6+
foreach ($this->symbolToName as $name) {
7+
- if ($name[0] === 'T') {
8+
+ if ($name[0] === 'T' && defined($name)) {
9+
$tokenMap[\constant($name)] = constant(static::class . '::' . $name);
10+
}
11+
}

tests/ClassNameResolver/ClassNameResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static function provideData(): Iterator
5656
public function testNoClassContained(string $filePath): void
5757
{
5858
$resolvedClassNames = $this->classNameResolver->resolveFromFilePath($filePath);
59-
$this->assertNull($resolvedClassNames);
59+
$this->assertNotInstanceOf(ClassNames::class, $resolvedClassNames);
6060
}
6161

6262
public static function provideNoClassContainedData(): Iterator

0 commit comments

Comments
 (0)