Skip to content

Commit 80dcee2

Browse files
committed
Allow phpstan 2.x
1 parent 9ab27fb commit 80dcee2

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
},
2121
"require-dev": {
2222
"phpunit/phpunit": "^8",
23-
"phpstan/phpstan": "^1.6",
24-
"phpstan/phpstan-deprecation-rules": "^1",
25-
"phpstan/phpstan-strict-rules": "^1.1",
26-
"phpstan/phpstan-phpunit": "^1",
23+
"phpstan/phpstan": "^1.12 || ^2",
24+
"phpstan/phpstan-deprecation-rules": "^1 || ^2",
25+
"phpstan/phpstan-strict-rules": "^1.1 || ^2",
26+
"phpstan/phpstan-phpunit": "^1 || ^2",
2727
"symfony/filesystem": "^5.4 || ^6"
2828
},
2929
"autoload": {

src/PhpFileParser.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class PhpFileParser
2424
*
2525
* @param string $path The file to check
2626
* @throws \RuntimeException
27-
* @return array<int, class-string> The found classes
27+
* @return list<class-string> The found classes
2828
*/
2929
public static function findClasses(string $path): array
3030
{
@@ -98,7 +98,9 @@ public static function findClasses(string $path): array
9898
$name = substr($name, 0, $colonPos);
9999
}
100100
}
101-
$classes[] = ltrim($namespace . $name, '\\');
101+
/** @var class-string */
102+
$className = ltrim($namespace . $name, '\\');
103+
$classes[] = $className;
102104
}
103105
}
104106

0 commit comments

Comments
 (0)