File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 "google/protobuf" : " ^5.34" ,
4343 "jetbrains/phpstorm-stubs" : " ^2025.3" ,
4444 "nikic/php-parser" : " ^5.0" ,
45- "phpstan/phpdoc-parser" : " ^1.20 "
45+ "phpstan/phpdoc-parser" : " ^2.3 "
4646 },
4747 "require-dev" : {
4848 "phpstan/extension-installer" : " ^1.2" ,
5151 "phpstan/phpstan-phpunit" : " ^2.0" ,
5252 "phpstan/phpstan-strict-rules" : " ^2.0" ,
5353 "phpunit/phpunit" : " ^12.0" ,
54- "slevomat/coding-standard" : " ^8.11 " ,
55- "squizlabs/php_codesniffer" : " ^3.7 "
54+ "slevomat/coding-standard" : " ^8.28 " ,
55+ "squizlabs/php_codesniffer" : " ^4.0 "
5656 },
5757 "scripts" : {
5858 "gen-bindings" : " protoc --proto_path=src/Bindings --php_out=src/Bindings src/Bindings/scip.proto" ,
Original file line number Diff line number Diff line change 383383 </properties >
384384 </rule >
385385 <rule ref =" SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax" />
386+ <rule ref =" SlevomatCodingStandard.TypeHints.DNFTypeHintFormat" >
387+ <properties >
388+ <property name =" withSpacesAroundOperators" value =" no" />
389+ <property name =" withSpacesInsideParentheses" value =" no" />
390+ <property name =" shortNullable" value =" yes" />
391+ <property name =" nullPosition" value =" last" />
392+ </properties >
393+ </rule >
386394 <rule ref =" SlevomatCodingStandard.TypeHints.LongTypeHints" />
387395 <rule ref =" SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition" />
388396 <rule ref =" SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
391399 <rule ref =" SlevomatCodingStandard.TypeHints.PropertyTypeHint" />
392400 <rule ref =" SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing" />
393401 <rule ref =" SlevomatCodingStandard.TypeHints.ReturnTypeHint" />
394- <rule ref =" SlevomatCodingStandard.TypeHints.UnionTypeHintFormat" >
395- <properties >
396- <property name =" withSpaces" value =" no" />
397- <property name =" shortNullable" value =" yes" />
398- <property name =" nullPosition" value =" last" />
399- </properties >
400- </rule >
401402 <rule ref =" SlevomatCodingStandard.TypeHints.UselessConstantTypeHint" />
402403
403404 <!-- Variables -->
Original file line number Diff line number Diff line change 1515use PHPStan \PhpDocParser \Parser \PhpDocParser ;
1616use PHPStan \PhpDocParser \Parser \TokenIterator ;
1717use PHPStan \PhpDocParser \Parser \TypeParser ;
18+ use PHPStan \PhpDocParser \ParserConfig ;
1819
1920use function count ;
2021
2627
2728 public function __construct ()
2829 {
29- $ usedAttributes = ['lines ' => true , 'indexes ' => true ];
30- $ constExprParser = new ConstExprParser (usedAttributes: $ usedAttributes );
31- $ typeParser = new TypeParser ( $ constExprParser , usedAttributes: $ usedAttributes );
32- $ this -> parser = new PhpDocParser ( $ typeParser , $ constExprParser, usedAttributes: $ usedAttributes );
33- $ this ->lexer = new Lexer ( );
30+ $ config = new ParserConfig (usedAttributes: ['lines ' => true , 'indexes ' => true ]) ;
31+ $ this -> lexer = new Lexer ( $ config );
32+ $ constExprParser = new ConstExprParser ( $ config );
33+ $ typeParser = new TypeParser ( $ config , $ constExprParser );
34+ $ this ->parser = new PhpDocParser ( $ config , $ typeParser , $ constExprParser );
3435 }
3536
3637 public function parsePropertyType (Node $ node ): ?TypeNode
You can’t perform that action at this time.
0 commit comments