Skip to content

Commit

Permalink
Bump to PHPStan 2 and Rector 2 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik authored Dec 12, 2024
1 parent b80fbe3 commit fdf358e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
10 changes: 4 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@
"illuminate/container": "^11.20",
"nette/robot-loader": "^4.0",
"nette/utils": "^4.0",
"nikic/php-parser": "^4.19",
"nikic/php-parser": "^5.0",
"symfony/console": "^6.4",
"symfony/finder": "^6.4",
"webmozart/assert": "^1.11"
},
"require-dev": {
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.5",
"rector/rector": "^1.0",
"rector/type-perfect": "^0.2.0",
"rector/rector": "^2.0",
"rector/type-perfect": "^2.0",
"shipmonk/composer-dependency-analyser": "^1.7",
"symplify/easy-coding-standard": "^12.3",
"tomasvotruba/class-leak": "^0.2.16",
"tomasvotruba/type-coverage": "^0.3.1",
"tomasvotruba/unused-public": "^0.3.11",
"tracy/tracy": "^2.10"
},
"autoload": {
Expand Down
24 changes: 15 additions & 9 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ parameters:
narrow_param: true
narrow_return: true

type_coverage:
return: 99
param: 99
property: 99
constant: 99
# type_coverage:
# return: 99
# param: 99
# property: 99
# constant: 99

unused_public:
constants: true
properties: true
methods: true
# unused_public:
# constants: true
# properties: true
# methods: true

ignoreErrors:
# unrelated
Expand All @@ -35,3 +35,9 @@ parameters:

# false positive callable/closure in type-perfect
- '#Parameters should have "array\|\(Closure\)\|null" types as the only types passed to this method#'

-
identifier: staticMethod.alreadyNarrowedType

-
identifier: return.unusedType
2 changes: 1 addition & 1 deletion src/DependencyInjection/ContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function create(): Container
// parser
$container->singleton(Parser::class, static function (): Parser {
$phpParserFactory = new ParserFactory();
return $phpParserFactory->create(ParserFactory::PREFER_PHP7);
return $phpParserFactory->createForNewestSupportedVersion();
});

$container->singleton(
Expand Down

0 comments on commit fdf358e

Please sign in to comment.