-
-
Notifications
You must be signed in to change notification settings - Fork 950
chore: introduce phpstan level 6 #7269
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
Conversation
| identifier: missingType.iterableValue | ||
| - | ||
| identifier: missingType.generics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iterableValue and generics are creating a lot of error, so I prefer to fix missing param/property/return type first
| - | ||
| identifier: missingType.property | ||
| paths: | ||
| - src/Doctrine/Common/Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ignored all the tests folder.
| - src/Symfony/Bundle/Test | ||
| - src/Symfony/Tests | ||
| - tests | ||
| - src # TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter is ~150 error, I'll do it in the next PR.
| paths: | ||
| - src/Symfony/Bundle/Test | ||
| - tests | ||
| - src # TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's around 50 error, I'll try in another PR.
| } | ||
|
|
||
| private function buildArrayValue(?\SimpleXMLElement $resource, string $key, mixed $default = null) | ||
| private function buildArrayValue(?\SimpleXMLElement $resource, string $key): ?array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default is never used
|
@soyuka The PHPStan error seems legit to me HttpOperation accepts the following param but then we're doing foreach on it. If someone pass a string instead of string[] you'll get a weird behavior.
|
|
Indeed, to me we should cast the |
| $uriVariables = []; | ||
| foreach ($operation->getUriVariables() ?? [] as $parameterName => $_) { | ||
| $parameter = $request->route($parameterName); | ||
| $parameter = $request->route((string) $parameterName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mhh actually this is weird, it's a hard problem though maybe we'll leave that for later ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an error saying that route is called with int|string instead of string, so I casted the value.
This value is also casted on the following line.
You prefer a phpstan-ignore-line ?
| * | ||
| * @return string[] | ||
| */ | ||
| public function getIris() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change the return type to ?array as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, done with c29eb43
src/Metadata/ApiProperty.php
Outdated
| * | ||
| * @return bool | ||
| */ | ||
| public function getGenId() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same we can return ?bool here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, done with c29eb43
Uh oh!
There was an error while loading. Please reload this page.