Skip to content

Commit

Permalink
restore original parser.neon config
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Feb 9, 2022
1 parent ec23bb4 commit 963b961
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 75 deletions.
File renamed without changes.
27 changes: 17 additions & 10 deletions config/phpstan/parser.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,39 @@
# this file overrides definitions from the config above
services:
defaultAnalysisParser:
factory: @rectorPathRoutingParser
factory: @pathRoutingParser
arguments!: []

cachedRectorParser:
class: PHPStan\Parser\CachedParser
arguments:
originalParser: @rectorParser
cachedNodesByStringCountMax: %cache.nodesByStringCountMax%
autowired: no
autowired: false

rectorSimpleParser:
class: PHPStan\Parser\CleaningParser
cachedRectorSimpleParser:
class: PHPStan\Parser\CachedParser
arguments:
wrappedParser: @currentPhpVersionSimpleDirectParser
autowired: no
originalParser: @rectorSimpleParser
cachedNodesByStringCountMax: %cache.nodesByStringCountMax%
autowired: false

rectorPathRoutingParser:
class: Rector\Core\PhpParser\Parser\RectorPathRoutingParser
pathRoutingParser:
class: PHPStan\Parser\PathRoutingParser
arguments:
phpstanPathRoutingParser: @pathRoutingParser
currentPhpVersionRichParser: @cachedRectorParser
autowired: no
currentPhpVersionSimpleParser: @cachedRectorSimpleParser
php8Parser: @php8Parser
autowired: false

rectorParser:
class: PHPStan\Parser\RichParser
arguments:
parser: @currentPhpVersionPhpParser
lexer: @currentPhpVersionLexer
autowired: no

rectorSimpleParser:
class: PHPStan\Parser\SimpleParser
arguments:
parser: @currentPhpVersionPhpParser
1 change: 0 additions & 1 deletion config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
__DIR__ . '/../src/Enum',
__DIR__ . '/../src/PhpParser/Node/CustomNode',
__DIR__ . '/../src/PhpParser/ValueObject',
__DIR__ . '/../src/PhpParser/Parser/RectorPathRoutingParser.php',
__DIR__ . '/../src/functions',
__DIR__ . '/../src/constants.php',

Expand Down
2 changes: 1 addition & 1 deletion e2e/php74-parse-static/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"php": "7.4",
"php": "7.4.*",
"api-platform/core": "^2.6",
"symfony/framework-bundle": "^5.4",
"symfony/http-client": "^5.4"
Expand Down
10 changes: 1 addition & 9 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ parameters:
scanDirectories:
- stubs

reportUnmatchedIgnoredErrors: false
# reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false

excludePaths:
Expand Down Expand Up @@ -603,11 +603,3 @@ parameters:
-
message: '#Array with keys is not allowed\. Use value object to pass data instead#'
path: packages/PhpAttribute/Printer/PhpAttributeGroupFactory.php

# on purpose to fix tests + old PHP version parsing code and keep compatbility
- '#Extending PHPStan\\Parser\\PathRoutingParser is not covered by backward compatibility promise\. The class might change in a minor PHPStan version#'

# false positive
-
message: '#Dead catch (.*?) ParseError is never thrown in the try block#'
path: src/PhpParser/Parser/RectorPathRoutingParser.php
3 changes: 0 additions & 3 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@
MyCLabsClassToEnumRector::class,
SpatieEnumClassToEnumRector::class,

// code for phpstan with named arguments
__DIR__ . '/src/PhpParser/Parser/RectorPathRoutingParser.php',

// test paths
'*/tests/**/Fixture/*',
'*/rules-tests/**/Fixture/*',
Expand Down
51 changes: 0 additions & 51 deletions src/PhpParser/Parser/RectorPathRoutingParser.php

This file was deleted.

0 comments on commit 963b961

Please sign in to comment.