Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Conversation

@alcaeus
Copy link
Member

@alcaeus alcaeus commented Dec 2, 2019

This brings in a newer PHPStan version that allows us to simplify the call by configuring paths and level in phpstan.neon.dist.

@alcaeus alcaeus added this to the 1.1.0 milestone Dec 2, 2019
@alcaeus alcaeus self-assigned this Dec 2, 2019

/**
* @return string[]|bool[]
* @return array<array<bool|string>>
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be also annotated as

Suggested change
* @return array<array<bool|string>>
* @return string[][]|bool[][]

That way not only static-analysis tools but PHPStorm will understand it too.

Copy link
Member

Choose a reason for hiding this comment

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

In this case, this should be avoided: the signature you proposed translates to array<array<bool>>|array<array<string>>, which is a different type

Copy link
Member Author

Choose a reason for hiding this comment

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

That is not the same though. The array<...> syntax allows for an array like this:

[
    ['foo', true],
    [true],
]

The "PHPStorm compatible" type does not properly allow for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, didn't know that nuance, thank you!

@alcaeus alcaeus merged commit f3e4e24 into master Dec 3, 2019
@alcaeus alcaeus deleted the update-dependencies branch December 3, 2019 15:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants