Drop PHP 7.4 and PHP 8.0 support#154
Merged
internalsystemerror merged 53 commits into4.8.xfrom Nov 19, 2022
Merged
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 <ocramius@gmail.com>
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 <ocramius@gmail.com>
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 <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…` 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 <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
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 <ocramius@gmail.com>
… static analysis issues Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…atic analysis issues Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…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 <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…gnature Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
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 <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…ming with PHP 8.1 Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Typo caused all tests to start failing. Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…ated test expectations Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Ocramius
commented
Nov 19, 2022
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…PHPCS crashing on it Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Member
Author
|
@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 |
internalsystemerror
requested changes
Nov 19, 2022
Member
internalsystemerror
left a comment
There was a problem hiding this comment.
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 <gary@creativecow.uk> Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Co-authored-by: Gary Lockett <gary@creativecow.uk> Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…tion#isEndingBrace()` Ref: #154 (comment) Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…adability Ref: #154 (comment) Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…cblock is to be imported Ref: #154 (comment) Signed-off-by: Marco Pivetta <ocramius@gmail.com>
… `BackedCases` Ref: #154 (comment) Signed-off-by: Marco Pivetta <ocramius@gmail.com>
nicolas-grekas
added a commit
to nicolas-grekas/laminas-code
that referenced
this pull request
Nov 25, 2022
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 <nicolas.grekas@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: