-
Notifications
You must be signed in to change notification settings - Fork 95
Static analysis with PHPStan #49
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
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.
nice, thank you!
@@ -31,7 +31,7 @@ | |||
class Paths implements SpecObjectInterface, DocumentContextInterface, ArrayAccess, Countable, IteratorAggregate | |||
{ | |||
/** | |||
* @var PathItem[] | |||
* @var (PathItem|null)[] |
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.
not sure if I understand this correctly. But this looks like it could be an array of nulls? does not make much sense to me.
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.
Look at line 53. The $_paths
array can contain null
s as it's items.
@@ -43,7 +43,7 @@ class Paths implements SpecObjectInterface, DocumentContextInterface, ArrayAcces | |||
|
|||
/** | |||
* Create an object from spec data. | |||
* @param PathItem[]|array[] $data spec data read from YAML or JSON | |||
* @param (PathItem|array|null)[] $data spec data read from YAML or JSON |
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 here, could you explain this change please?
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 reason as above..
Co-Authored-By: Carsten Brandt <[email protected]>
Thank you! |
I got it up to level 5 with just a few simple changes, but level 6 starts to reqire typehints and suddenly we have 150+ errors, so level 5 it is for now..