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

Allow usage with PSR-7 v2 #136

Merged
merged 14 commits into from
May 1, 2023

Commits on Apr 18, 2023

  1. fix: adapts code to work with v2 of PSR-7 interfaces

    Many tests become redundant with proper types present.
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    76c9d36 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2023

  1. refactor: use updated versions of PSR-17 interfaces and integration t…

    …ests
    
    - Updates to version 1.0.2 of the PSR-17 interfaces, which allow usage with PSR-7 v2
    - Updates to version 1.3.0 of the psr7-integration-tests, which allow usage with PSR-7 1.1 and 2.0.
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    b1ca975 View commit details
    Browse the repository at this point in the history
  2. refactor: remove obsolete type checks where possible

    Due to updating to use PSR-7 v2, we can remove a number of conditionals that did type-checking, and also update constructors to use union types to fully type the API exposed.
    Doing so removes the need for some unit tests, as type errors will now be guaranteed by the runtime.
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    1badd91 View commit details
    Browse the repository at this point in the history
  3. qa: apply phpcs fixes, and ensure tests pass

    - Updates the ref for the PSR-7 integration tests with a version known to work.
    - Fixes the signature of `CallbackStream::seek` to add the `void` return declaration.
    - Applies CS rules.
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    e84d1b1 View commit details
    Browse the repository at this point in the history
  4. qa: resolve errors flagged by Psalm

    - Update to stable http-factory with support for PSR-7 v2.
    - Updates to add settings that will be required with Psalm 6.
    - Removes some unnecessary type checks, as parameter type declarations are now present.
    - Updates tests to remove assertions about types when they are known.
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    b47c358 View commit details
    Browse the repository at this point in the history
  5. qa: fixes CS issues flagged by phpcs

    Unused import statements
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    22eca5b View commit details
    Browse the repository at this point in the history
  6. qa: reinstate some of the invalid protocol version tests

    We still need to test _string_ versions that resolve to unsupported protocol versions.
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    e324ad6 View commit details
    Browse the repository at this point in the history
  7. qa: remove redundant assigments

    Per @Xerkus
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    60d5459 View commit details
    Browse the repository at this point in the history
  8. qa: remove unneeded psalm-suppressions

    Per @Xerkus
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    72d8e24 View commit details
    Browse the repository at this point in the history
  9. qa: add missing param type declaration for `RequestTrait::withRequest…

    …Target()`
    
    should be string!
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    a086fd1 View commit details
    Browse the repository at this point in the history
  10. qa: add string param declaration for $version argument of `MessageT…

    …rait::validateProtocolVersion`
    
    We know it's a string internally, so we can mark it one here, and remove a redundant conditional.
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    6eb9ce6 View commit details
    Browse the repository at this point in the history
  11. qa: Make $size argument to UplaodedFile constructor nullable

    Since the `UploadedFileFactoryInterface` allows nullable size, not allowing it here could lead to an error condition.
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    ddf9497 View commit details
    Browse the repository at this point in the history
  12. qa: fix CS issues and update baseline to remove unused entries

    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    b5f2b9e View commit details
    Browse the repository at this point in the history
  13. qa: rename method parameters to follow PSR-7 spec

    - `ServerRequest` `getAttribute` and `withAttribute` methods: rename `$attribute` to `$name`.
    - `StreamFactory::createStreamFromFile()`: rename `$file` to `$filename`
    
    Signed-off-by: Matthew Weier O'Phinney <[email protected]>
    weierophinney committed May 1, 2023
    Configuration menu
    Copy the full SHA
    be030a0 View commit details
    Browse the repository at this point in the history