Skip to content

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

Merged
merged 5 commits into from
Dec 13, 2019
Merged

Static analysis with PHPStan #49

merged 5 commits into from
Dec 13, 2019

Conversation

lookyman
Copy link
Contributor

@lookyman lookyman commented Dec 5, 2019

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..

Copy link
Owner

@cebe cebe left a 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)[]
Copy link
Owner

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.

Copy link
Contributor Author

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 nulls 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
Copy link
Owner

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reason as above..

@cebe cebe added this to the 1.4 milestone Dec 5, 2019
@cebe cebe added the enhancement New feature or request label Dec 5, 2019
@cebe cebe self-assigned this Dec 5, 2019
Co-Authored-By: Carsten Brandt <[email protected]>
@cebe cebe merged commit 053bcee into cebe:master Dec 13, 2019
@cebe
Copy link
Owner

cebe commented Dec 13, 2019

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants