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

Introduce result objects and improve static analysis #267

Merged
merged 11 commits into from
Jan 8, 2024

Commits on Jan 8, 2024

  1. Remove unused psaml configuration

    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    7aca44f View commit details
    Browse the repository at this point in the history
  2. Update list of ignored files for distribution

    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    122ee3f View commit details
    Browse the repository at this point in the history
  3. Remove inline PHPCS ignores

    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    fc4cc08 View commit details
    Browse the repository at this point in the history
  4. Be explicit regarding class-strings

    Allowing us to remove the `assert()` calls from the code.
    
    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    56f9a24 View commit details
    Browse the repository at this point in the history
  5. Remove ignored errors from PHPStan configuration

    This makes things easier to be updated.
    
    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    39eef46 View commit details
    Browse the repository at this point in the history
  6. Add stronger type validation to calls

    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    e3372fb View commit details
    Browse the repository at this point in the history
  7. Introduce result objects

    Using arrays for the dispatching result hinders type safety and forces
    us to dynamically verify what has happened.
    
    This introduces result objects with read-only public variables that are
    backwards compatible with the array shapes we were using, providing more
    flexibility and a type-based way to know if we have or not a match.
    
    It's really important to mention that we aren't calling the constructor
    with promoted read-only variables because of the average overhead of 60% on
    dispatching operations. Introducing objects with public properties also
    has an impact but it's significantly smaller (average overhead of 12%).
    
    I do believe that having an object there helps - as previously requested
    by several people.
    
    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    67e0e40 View commit details
    Browse the repository at this point in the history
  8. Ignore errors about array shape of cached data

    Verifying the shape to match our expectations would incur in unnecessary
    performance impact.
    
    This ignores the errors, accepting the situation.
    
    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    13e7c84 View commit details
    Browse the repository at this point in the history
  9. Increase PHPStan level to maximum

    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    f8f4536 View commit details
    Browse the repository at this point in the history
  10. Centralise array shape definitions

    This makes things much less error-prone.
    
    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    66bc64e View commit details
    Browse the repository at this point in the history
  11. Define retry threshold for PHPBench

    Signed-off-by: Luís Cobucci <[email protected]>
    lcobucci committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    1de335f View commit details
    Browse the repository at this point in the history