PackageTrack
Sign in Get early access

middlewares/utils

Common utils for PSR-15 middleware packages

v4.0.2 4.0M downloads/mo #2293 most downloaded on Packagist middlewares/utils

What this package is like to depend on

Last release 2 years ago

no release in 18 months

Release timing varies

gaps range from 9 days to 2.5 years

Nearly every release is documented

notes for 33 of 33 stable releases

Nothing withdrawn

no release was ever pulled

10 years old

33 releases · first in 2016

0 releases in the last 12 months

see the full history below

Release timeline

33 releases · Sep 2016 to Jan 2025
2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 33
  1. v4.0.2 23 Jan 2025
    Release notes Open source →
    Release notes

    Fixed

    • PHP 8.4 deprecation errors (implicitly nullable parameter) [#30]
    Open source →
  2. v4.0.1 21 Nov 2024
    Release notes Open source →
    Release notes

    Fixed

    • Support for Php 8.4 [#29].
    Open source →
  3. v4.0.0 17 Dec 2023
    Release notes

    See CHANGELOG

    Typo in the changelog:

    • Support for PHP prior to 8.2 8.1.
    Open source →
    Release notes

    Added

    • Support for psr/http-message 2.x (if you don't use slim/psr7 or sunrise/http-message as factory)

    Changed

    • Updated dependencies and tests

    Removed

    • Support for PHP prior to 8.1.
    Open source →
  4. v3.3.0 04 Jul 2021
    Release notes Open source →
    Release notes

    Added

    • Support for psr/container v2.x [#26]
    Open source →
  5. v3.2.0 30 Nov 2020
    Release notes Open source →
    Release notes

    Fixed

    • Added support for PHP 8 [#22] [#23]
    Open source →
  6. v3.1.0 19 Jan 2020
    Release notes Open source →
    Release notes

    Changed

    • Zend Diactoros is deprecated, switched to Laminas Diactoros [#20], [#21]. THIS IS A BREAKING CHANGE, so, if you want to keep using Zend Diactoros, you should configure the Factory as follows:
      Factory::setFactory(
        new FactoryDiscovery([
            'request' => 'Zend\Diactoros\RequestFactory',
            'response' => 'Zend\Diactoros\ResponseFactory',
            'serverRequest' => 'Zend\Diactoros\ServerRequestFactory',
            'stream' => 'Zend\Diactoros\StreamFactory',
            'uploadedFile' => 'Zend\Diactoros\UploadedFileFactory',
            'uri' => 'Zend\Diactoros\UriFactory',
        ])
      );
      
    Open source →
  7. v3.0.1 29 Nov 2019
    Release notes Open source →
    Release notes

    Fixed

    • Moved a dependency to dev
    • Updated docs
    Open source →
  8. v3.0.0 29 Nov 2019
    Release notes Open source →
    Release notes

    Added

    • Added FactoryInterface that returns all PSR-17 factories
    • Added FactoryDiscovery class to discover automatically PSR-17 implementation libraries
    • Added Factory::getFactory() and Factory::setFactory() to set manually PSR-17 factories
    • Added Factory::getResponseFactory()
    • Added Factory::getRequestFactory()
    • Added Factory::getServerRequestFactory()
    • Added Factory::getStreamFactory()
    • Added Factory::getUriFactory()
    • Added Factory::getUploadedFileFactory()
    • Added Sunrise to the list of factories detected automatically

    Removed

    • Support for PHP 7.0 and 7.1
    • Factory::setStrategy
    • HttpErrorException::setContext method, to make the exception class inmutable
    • Traits HasResponseFactory and HasStreamFactory
    Open source →
  9. v2.2.0 05 Mar 2019
    Release notes Open source →
    Release notes

    Added

    • Middlewares\Utils\Dispatcher implements RequestHandlerInterface [#16], [#17]
    Open source →
  10. v2.1.1 11 Aug 2018
    Release notes Open source →
    Release notes

    Added

    • Added Nyholm\Psr7 to the list of factories detected automatically
    Open source →
  11. v2.1.0 02 Aug 2018
    Release notes

    Added

    • New trait HasResponseFactory used by many middlewares that need to configure the PSR-17 response factory.
    • New trait HasStreamFactory used by many middlewares that need to configure the PSR-17 stream factory.
    Open source →
  12. v2.0.0 01 Aug 2018
    Release notes

    Added

    • New methods added to Factory to return PSR-17 factories: getResponseFactory, getServerRequestFactory, getStreamFactory and getUriFactory.
    • New method Factory::setStrategies() to configure the priority order of the Diactoros, Guzzle and Slim factories or register new classes.
    • Added a second argument to Callablehandler constructor to pass a response factory

    Changed

    • Exchanged abandoned http-interop/http-factory with psr/http-factory
    • Changed the signature of Factory::createServerRequest() to be aligned with PSR-17
    • Changed the signature of Factory::createStream() to be aligned with PSR-17
    • Changed the signature of Factory::createResponse() to be aligned with PSR-17
    Open source →
  13. v1.2.0 17 Jul 2018
    Release notes

    Changed

    • Updated http-interop/http-factory to 0.4
    Open source →
  14. v1.1.0 25 Jun 2018
    Release notes

    Added

    • Imported HttpErrorException from error handler middleware
    Open source →
  15. v1.0.0 24 Jan 2018
    Release notes

    Changed

    • Replaced http-interop/http-server-middleware with psr/http-server-middleware.

    Removed

    • Removed Middlewares\Utils\Helpers because contains just one helper and it's no longer needed.
    Open source →
  16. v0.14.0 16 Dec 2017
    Release notes

    Added

    • New class RequestHandlerContainer implementing PSR-11 to resolve handlers in any format (classes, callables) and return PSR-15 RequestHandlerInterface instances. This can be used to resolve router handlers, for example.

    Changed

    • The signature of CallableHandler was simplified. Removed $resolver and $arguments in the constructor.

    Removed

    • Deleted all callable resolvers classes. Use the RequestHandlerContainer, or any other PSR-11 implementation.
    Open source →
  17. v0.13.0 16 Nov 2017
    Release notes

    Changed

    • The minimum PHP version supported is 7.0
    • Replaced http-interop/http-middleware with http-interop/http-server-middleware.
    • Changed Middlewares\Utils\CallableHandler signature. Now it is instantiable and can be used as middleware and server request handler.

    Removed

    • Middlewares\Utils\CallableMiddleware. Use Middlewares\Utils\CallableHandler instead.
    Open source →
  18. v0.12.0 18 Sep 2017
    Release notes

    Changed

    • Append .dist suffix to phpcs.xml and phpunit.xml files
    • Changed the configuration of phpcs and php_cs
    • Upgraded phpunit to the latest version and improved its config file
    • Updated http-interop/http-middleware to 0.5
    Open source →
  19. v0.11.1 06 May 2017
    Release notes

    Changed

    • Middlewares\Utils\CallableHandler expects one of the following values returned by the callable:
      • A Psr\Http\Message\ResponseInterface
      • null or scalar
      • an object with __toString method implemented Otherwise, throws an UnexpectedValueException
    • Middlewares\Helpers::fixContentLength only modifies or removes the Content-Length header, but does not add it if didn't exist previously.
    Open source →
  20. v0.11.0 25 Mar 2017
    Release notes

    Added

    • New class Middlewares\Utils\Helpers with common helpers to manipulate PSR-7 messages
    • New helper Middlewares\Utils\Helpers::fixContentLength used to add/modify/remove the Content-Length header of a http message.

    Changed

    • Updated http-interop/http-factory to 0.3
    Open source →
  21. v0.10.1 27 Feb 2017
    Release notes

    Fixed

    • Fixed changelog file
    Open source →
  22. v0.10.0 27 Feb 2017
    Release notes

    Changed

    • Replaced deprecated container-interop by psr/contaienr (PSR-11).
    • Middlewares\Utils\Dispatcher throws exceptions if the middlewares does not implement Interop\Http\ServerMiddleware\MiddlewareInterface or does not return an instance of Psr\Http\Message\ResponseInterface.
    • Moved the default factories to Middlewares\Utils\Factory namespace.
    • Minor code improvements.
    Open source →
  23. v0.9.0 05 Feb 2017
    Release notes

    Added

    • Callable resolves to create callables from various representations

    Removed

    • Middlewares\Utils\CallableHandler::resolve
    Open source →
  24. v0.8.0 22 Dec 2016
    Release notes

    Changed

    • Updated http-interop/http-middleware to 0.4
    • Updated friendsofphp/php-cs-fixer to 2.0
    Open source →
  25. v0.7.0 06 Dec 2016
    Release notes

    Added

    • New static helper Middlewares\Utils\Dispatcher::run to create and dispatch a request easily
    Open source →
  26. v0.6.1 06 Dec 2016
    Release notes

    Fixed

    • Ensure that the body of the serverRequest is writable and seekable.
    Open source →
  27. v0.6.0 06 Dec 2016
    Release notes

    Added

    • ServerRequest factory
    • Middlewares\Utils\Dispatcher accepts Closure as middleware components

    Changed

    • Middlewares\Utils\Dispatcher creates automatically a response if the stack is exhausted
    Open source →
  28. v0.5.0 22 Nov 2016
    Release notes

    Added

    • Middlewares\Utils\CallableMiddleware class, to create middlewares from callables
    • Middlewares\Utils\Dispatcher class, to execute the middleware stack and return a response.
    Open source →
  29. v0.4.0 13 Nov 2016
    Release notes

    Changed

    • Updated http-interop/http-factory to 0.2
    Open source →
  30. v0.3.1 03 Oct 2016
    Release notes

    Fixed

    • Bug in CallableHandler that resolve to the declaring class of a method instead the final class.
    Open source →
  31. v0.3.0 03 Oct 2016
    Release notes

    Added

    • Middlewares\Utils\CallableHandler class, allowing to resolve and execute callables safely.
    Open source →
  32. v0.2.0 01 Oct 2016
    Release notes

    Added

    • Uri factory
    Open source →
  33. v0.1.0 30 Sep 2016
    Release notes

    Added

    • Response factory
    • Stream factory
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive