Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test dev phpdoc/parser #1406

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ondram/ci-detector": "^3.4.0",
"ondrejmirtes/better-reflection": "5.3.0.16",
"phpstan/php-8-stubs": "0.3.14",
"phpstan/phpdoc-parser": "1.5.1",
"phpstan/phpdoc-parser": "1.6.x-dev",
"react/child-process": "^0.6.4",
"react/event-loop": "^1.2",
"react/http": "^1.1",
Expand Down
18 changes: 10 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions conf/bleedingEdge.neon
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ parameters:
consistentConstructor: true
checkUnresolvableParameterTypes: true
readOnlyByPhpDoc: true
phpDocParserRequireWhitespaceBeforeDescription: true
4 changes: 4 additions & 0 deletions conf/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ parameters:
consistentConstructor: false
checkUnresolvableParameterTypes: false
readOnlyByPhpDoc: false
phpDocParserRequireWhitespaceBeforeDescription: false
fileExtensions:
- php
checkAdvancedIsset: false
Expand Down Expand Up @@ -239,6 +240,7 @@ parametersSchema:
consistentConstructor: bool()
checkUnresolvableParameterTypes: bool()
readOnlyByPhpDoc: bool()
phpDocParserRequireWhitespaceBeforeDescription: bool()
])
fileExtensions: listOf(string())
checkAdvancedIsset: bool()
Expand Down Expand Up @@ -453,6 +455,8 @@ services:

-
class: PHPStan\PhpDocParser\Parser\PhpDocParser
arguments:
requireWhitespaceBeforeDescription: %featureToggles.phpDocParserRequireWhitespaceBeforeDescription%

-
class: PHPStan\PhpDoc\PhpDocInheritanceResolver
Expand Down
14 changes: 3 additions & 11 deletions tests/PHPStan/Rules/PhpDoc/InvalidPhpDocTagValueRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ public function testRule(): void
'PHPDoc tag @param has invalid value (): Unexpected token "\n * ", expected type at offset 13',
25,
],
[
'PHPDoc tag @param has invalid value ($invalid): Unexpected token "$invalid", expected type at offset 24',
25,
],
[
'PHPDoc tag @param has invalid value ($invalid Foo): Unexpected token "$invalid", expected type at offset 43',
25,
],
[
'PHPDoc tag @param has invalid value (A & B | C $paramNameA): Unexpected token "|", expected variable at offset 72',
25,
Expand Down Expand Up @@ -76,10 +68,10 @@ public function testRule(): void
'PHPDoc tag @var has invalid value (\\\Foo|\Bar $test): Unexpected token "\\\\\\\Foo|\\\Bar", expected type at offset 9',
29,
],
/*[
'PHPDoc tag @var has invalid value ...',
[
'PHPDoc tag @var has invalid value (callable(int)): Unexpected token "(", expected TOKEN_HORIZONTAL_WS at offset 17',
59,
],*/
],
[
'PHPDoc tag @var has invalid value ((Foo|Bar): Unexpected token "*/", expected \')\' at offset 18',
62,
Expand Down