chore: introduce phpstan level 6#7269
Conversation
| identifier: missingType.iterableValue | ||
| - | ||
| identifier: missingType.generics |
There was a problem hiding this comment.
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.
I ignored all the tests folder.
| - src/Symfony/Bundle/Test | ||
| - src/Symfony/Tests | ||
| - tests | ||
| - src # TODO |
There was a problem hiding this comment.
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.
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.
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.
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.
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.
can we change the return type to ?array as well?
| * | ||
| * @return bool | ||
| */ | ||
| public function getGenId() |
Uh oh!
There was an error while loading. Please reload this page.