Skip to content
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

Merged
merged 53 commits into from Nov 19, 2022

Commits on Nov 18, 2022

  1. Drop PHP 7 support to improve type inference

    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>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    984b5a6 View commit details
    Browse the repository at this point in the history
  2. Deprecating ParameterReflection#detectType() and its callers

    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>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    b310381 View commit details
    Browse the repository at this point in the history
  3. Further restricting supported PHP version to ~8.1.0

    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>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    9f5036b View commit details
    Browse the repository at this point in the history
  4. Removed execution branches that are no longer reachable as per PHP 8.1

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    c1194ac View commit details
    Browse the repository at this point in the history
  5. Refactored EnumGenerator internals to leverage PHP 8.1 semantics

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    d6b1e4d View commit details
    Browse the repository at this point in the history
  6. Corrected inference imprecisions in `ClassGenerator::fromReflection()…

    …` 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>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    8032b87 View commit details
    Browse the repository at this point in the history
  7. Adjusted sorting of docblock deprecations

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    7b43090 View commit details
    Browse the repository at this point in the history
  8. Re-generated psalm baseline

    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>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    3c509cd View commit details
    Browse the repository at this point in the history
  9. Cleaning up ParameterReflection internals to get rid of low-hanging…

    … static analysis issues
    
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    8935aa3 View commit details
    Browse the repository at this point in the history
  10. Cleaning up MethodReflection internals to get rid of low-hanging st…

    …atic analysis issues
    
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    fb722e0 View commit details
    Browse the repository at this point in the history
  11. Deprecate FunctionReflection#getReturn(), which was initially abuse…

    …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>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    6419d21 View commit details
    Browse the repository at this point in the history
  12. Removed unused import

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    8f3de55 View commit details
    Browse the repository at this point in the history
  13. Rewrote FunctionReflection#getParameters() to match parent types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    ab1312b View commit details
    Browse the repository at this point in the history
  14. Adjusted parameter name to match parent class parameter name

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    c7dcbb8 View commit details
    Browse the repository at this point in the history
  15. Adjusted parameter name to match parent class parameter name

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    d4b761e View commit details
    Browse the repository at this point in the history
  16. More precise definition of ThrowsTag#$description state

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    373c3ea View commit details
    Browse the repository at this point in the history
  17. Better type definitions around ReturnTag

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    59b3947 View commit details
    Browse the repository at this point in the history
  18. Better type definitions around PropertyTag

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    25c294b View commit details
    Browse the repository at this point in the history
  19. Better type definitions around ParamTag

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    8266966 View commit details
    Browse the repository at this point in the history
  20. Better type definitions around MethodTag

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    d5f1ec1 View commit details
    Browse the repository at this point in the history
  21. Better type definitions around LicenseTag

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    4eafd0d View commit details
    Browse the repository at this point in the history
  22. Better type definitions around GenericTag

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    2abd393 View commit details
    Browse the repository at this point in the history
  23. Better type definitions around AuthorTag

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    c99a924 View commit details
    Browse the repository at this point in the history
  24. Aligning ClassReflection types to PHP's ReflectionClass parent si…

    …gnature
    
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    fc3d146 View commit details
    Browse the repository at this point in the history
  25. Improved PrototypeClassFactory internal types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    f66517e View commit details
    Browse the repository at this point in the history
  26. Improved ValueGenerator internal types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    40d9e7e View commit details
    Browse the repository at this point in the history
  27. Deprecating ValueGenerator#initEnvironmentConstants()

    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>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    a994a53 View commit details
    Browse the repository at this point in the history
  28. Refining TraitUsageInterface types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    638cfda View commit details
    Browse the repository at this point in the history
  29. Refining PropertyGenerator types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    667463f View commit details
    Browse the repository at this point in the history
  30. Refining ParameterGenerator types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    993bb94 View commit details
    Browse the repository at this point in the history
  31. Refining InterfaceGenerator and MethodGenerator types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    6c1b254 View commit details
    Browse the repository at this point in the history
  32. Refining FileGenerator types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    d5f3886 View commit details
    Browse the repository at this point in the history
  33. Refining AbstractTypeableTag types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    a18791d View commit details
    Browse the repository at this point in the history
  34. Refining PropertyTag types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    3d86e90 View commit details
    Browse the repository at this point in the history
  35. Refining MethodTag types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    ffa2dda View commit details
    Browse the repository at this point in the history
  36. Refining LicenseTag types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    9ba9cec View commit details
    Browse the repository at this point in the history
  37. Refining AuthorTag types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    9ff6ac1 View commit details
    Browse the repository at this point in the history
  38. Refining Tag types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    9d367b1 View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2022

  1. Refining ClassGenerator and TraitUsage* types

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    d73a64a View commit details
    Browse the repository at this point in the history
  2. Replacing is_object($v) ? get_class($v) : gettype($v) ternaries wit…

    …h `get_debug_type()`
    
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    fec8485 View commit details
    Browse the repository at this point in the history
  3. Regenerated psalm baseline with the now in place type improvements co…

    …ming with PHP 8.1
    
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    78d7f80 View commit details
    Browse the repository at this point in the history
  4. Rewrote ParameterReflection#getClass() to match previous behavior

    Typo caused all tests to start failing.
    
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    2145694 View commit details
    Browse the repository at this point in the history
  5. Since we now use get_debug_type() for some errors, adjusting associ…

    …ated test expectations
    
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    6e5e3e2 View commit details
    Browse the repository at this point in the history
  6. Using CI setup that we use in all other repositories

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    52f2c24 View commit details
    Browse the repository at this point in the history
  7. Added default Laminas CI setup

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    172ce58 View commit details
    Browse the repository at this point in the history
  8. Applied automated CS fixes

    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    a362091 View commit details
    Browse the repository at this point in the history
  9. Moved complex array shape docblock to the class definition, to avoid …

    …PHPCS crashing on it
    
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    487c2e2 View commit details
    Browse the repository at this point in the history
  10. Corrected inheritDoc syntax as per code review suggestions

    Co-authored-by: Gary Lockett <gary@creativecow.uk>
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius and Gary Lockett committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    07b00d1 View commit details
    Browse the repository at this point in the history
  11. Corrected inheritDoc syntax as per code review suggestions

    Co-authored-by: Gary Lockett <gary@creativecow.uk>
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius and Gary Lockett committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    2e5b315 View commit details
    Browse the repository at this point in the history
  12. Added a default execution branch that returns null in `MethodReflec…

    …tion#isEndingBrace()`
    
    Ref: #154 (comment)
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    a9d601d View commit details
    Browse the repository at this point in the history
  13. Applied De Morgan's law to a complex boolean expression to improve re…

    …adability
    
    Ref: #154 (comment)
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    66064ca View commit details
    Browse the repository at this point in the history
  14. Replaced {@inheritdoc} with @inheritDoc where the whole parent do…

    …cblock is to be imported
    
    Ref: #154 (comment)
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    dd68158 View commit details
    Browse the repository at this point in the history
  15. Simplified EnumGenerator to have more explicit codegen logic around…

    … `BackedCases`
    
    Ref: #154 (comment)
    Signed-off-by: Marco Pivetta <ocramius@gmail.com>
    Ocramius committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    6373921 View commit details
    Browse the repository at this point in the history