-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Drop PHP 7.4 and PHP 8.0 support #154
Conversation
Because we operate with reflection symbols for attributes, we want to be on at least PHP 8.0, in order to have Psalm and PHPUnit access all the relevant types related to attributes. Signed-off-by: Marco Pivetta <[email protected]>
This API is old, bad, and not really useful, as it produces a string representation of functions/methods that doesn't bring much to the table: in fact, it is easier to inspect the AST of a symbol, than to look at its string or array prototype. These methods will be dropped in the next major release, as they are prone to crashes due to union/intersection types on PHP 8.1 and newer, and it is not worth investing the time to fix them. Signed-off-by: Marco Pivetta <[email protected]>
This is because we really do a lot of stuff with ENUMs, and it is a massive pain to run all checks on an older inferred PHP version. By doing this, we can refine the types of various ENUM structures in our core logic in subsequent commits. Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
…` around constants This is because we were still using the array-style logic for creating constants inside `ClassGenerator::fromReflection()`: switching to the programmatic API makes things much more readable Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Note: because psalm has imprecise stubs around ENUM reflection symbols, some issues cannot currently be prevented. Ref: vimeo/psalm#8720 Signed-off-by: Marco Pivetta <[email protected]>
… static analysis issues Signed-off-by: Marco Pivetta <[email protected]>
…atic analysis issues Signed-off-by: Marco Pivetta <[email protected]>
…d by `laminas/laminas-server` This method attempted to discover the return type of a function, but in a world where return types didn't exist yet (before PHP 7.0). This method has outlived its usefulness, and is now targeted for removal. Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
…gnature Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
This API is not suitable for maintenance: the `ValueGenerator` attempts to load defined constants into its scope, and then uses them to generate constant expressions (rather than values). This is risky business, and should be avoided: it will be removed in the next major release. Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
…ming with PHP 8.1 Signed-off-by: Marco Pivetta <[email protected]>
Typo caused all tests to start failing. Signed-off-by: Marco Pivetta <[email protected]>
…ated test expectations Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
Signed-off-by: Marco Pivetta <[email protected]>
…PHPCS crashing on it Signed-off-by: Marco Pivetta <[email protected]>
@gsteel @internalsystemerror I tried keeping my changes limited to internals: wherever the API would even change in behavior, I'd instead adjust the docblocks. This is mostly preparation work for the shower of |
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.
Some requests but mostly suggestions. This must have taken you some time (given how long it took to review) so a big thank you to you!
Co-authored-by: Gary Lockett <[email protected]> Signed-off-by: Marco Pivetta <[email protected]>
Co-authored-by: Gary Lockett <[email protected]> Signed-off-by: Marco Pivetta <[email protected]>
…tion#isEndingBrace()` Ref: #154 (comment) Signed-off-by: Marco Pivetta <[email protected]>
…adability Ref: #154 (comment) Signed-off-by: Marco Pivetta <[email protected]>
…cblock is to be imported Ref: #154 (comment) Signed-off-by: Marco Pivetta <[email protected]>
… `BackedCases` Ref: #154 (comment) Signed-off-by: Marco Pivetta <[email protected]>
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.
LGTM
This was removed in laminas#154 but this phpdoc is useful to some static analyzers, so that they can know what the future return-type is going to be. Signed-off-by: Nicolas Grekas <[email protected]>
This patch overhauls the various types in use in this package, and requires PHP 8.1 to do so, and to achieve parity with the current ENUM integrations.
TODOs:
Improvement: