Skip to content

2.0.0

@weierophinney weierophinney tagged this 27 Sep 19:49
Based on https://github.com/zendframework/zend-diactoros/releases/tag/2.0.0 (commit 1d0facc8d07e7523bfed8245c2e4fd1d2590fa5d in this repo)

Added
-----

- [zendframework/zend-diactoros#326](https://github.com/zendframework/zend-diactoros/pull/326) adds [PSR-17](https://www.php-fig.org/psr/psr-17/) HTTP Message Factory implementations, including:

  - `Laminas\Diactoros\RequestFactory`
  - `Laminas\Diactoros\ResponseFactory`
  - `Laminas\Diactoros\ServerRequestFactory`
  - `Laminas\Diactoros\StreamFactory`
  - `Laminas\Diactoros\UploadedFileFactory`
  - `Laminas\Diactoros\UriFactory`

  These factories may be used to produce the associated instances; we encourage
  users to rely on the PSR-17 factory interfaces to allow exchanging PSR-7
  implementations within their applications.

- [zendframework/zend-diactoros#328](https://github.com/zendframework/zend-diactoros/pull/328) adds a package-level exception interface, `Laminas\Diactoros\Exception\ExceptionInterface`,
  and several implementations for specific exceptions raised within the package.
  These include:

  - `Laminas\Diactoros\Exception\DeserializationException` (extends `UnexpectedValueException`)
  - `Laminas\Diactoros\Exception\InvalidArgumentException` (extends `InvalidArgumentException`)
  - `Laminas\Diactoros\Exception\InvalidStreamPointerPositionException` (extends `RuntimeException`)
  - `Laminas\Diactoros\Exception\SerializationException` (extends `UnexpectedValueException`)
  - `Laminas\Diactoros\Exception\UnreadableStreamException` (extends `RuntimeException`)
  - `Laminas\Diactoros\Exception\UnrecognizedProtocolVersionException` (extends `UnexpectedValueException`)
  - `Laminas\Diactoros\Exception\UnrewindableStreamException` (extends `RuntimeException`)
  - `Laminas\Diactoros\Exception\UnseekableStreamException` (extends `RuntimeException`)
  - `Laminas\Diactoros\Exception\UntellableStreamException` (extends `RuntimeException`)
  - `Laminas\Diactoros\Exception\UnwritableStreamException` (extends `RuntimeException`)
  - `Laminas\Diactoros\Exception\UploadedFileAlreadyMovedException` (extends `RuntimeException`)
  - `Laminas\Diactoros\Exception\UploadedFileErrorException` (extends `RuntimeException`)

Changed
-------

- [zendframework/zend-diactoros#329](https://github.com/zendframework/zend-diactoros/pull/329) adds return type hints and scalar parameter type hints wherever possible.
  The changes were done to help improve code quality, in part by reducing manual
  type checking. If you are extending any classes, you may need to update your
  signatures; check the signatures of the class(es) you are extending for changes.

- [zendframework/zend-diactoros#162](https://github.com/zendframework/zend-diactoros/pull/162) modifies `Serializer\Request` such that it now no longer raises an `UnexpectedValueException` via its `toString()` method
  when an unexpected HTTP method is encountered; this can be done safely, as the value can never
  be invalid due to other changes in the same patch.

- [zendframework/zend-diactoros#162](https://github.com/zendframework/zend-diactoros/pull/162) modifies `RequestTrait` such that it now invalidates non-string method arguments to either
  the constructor or `withMethod()`, raising an `InvalidArgumentException` for any that do not validate.

Deprecated
----------

- Nothing.

Removed
-------

- [zendframework/zend-diactoros#308](https://github.com/zendframework/zend-diactoros/pull/308) removes the following methods from the `ServerRequestFactory` class:
  - `normalizeServer()` (use `Laminas\Diactoros\normalizeServer()` instead)
  - `marshalHeaders()` (use `Laminas\Diactoros\marshalHeadersFromSapi()` instead)
  - `marshalUriFromServer()` (use `Laminas\Diactoros\marshalUriFromSapi()` instead)
  - `marshalRequestUri()` (use `Uri::getPath()` from the `Uri` instance returned by `marshalUriFromSapi()` instead)
  - `marshalHostAndPortFromHeaders()` (use `Uri::getHost()` and `Uri::getPort()` from the `Uri` instances returned by `marshalUriFromSapi()` instead)
  - `stripQueryString()` (use `explode("?", $path, 2)[0]` instead)
  - `normalizeFiles()` (use `Laminas\Diactoros\normalizeUploadedFiles()` instead)

- [zendframework/zend-diactoros#295](https://github.com/zendframework/zend-diactoros/pull/295) removes `Laminas\Diactoros\Server`. You can use the `RequestHandlerRunner` class from
  [laminas/laminas-httphandlerrunner](https://docs.laminas.dev/laminas-httphandlerrunner) to provide these capabilities instead.

- [zendframework/zend-diactoros#295](https://github.com/zendframework/zend-diactoros/pull/295) removes `Laminas\Diactoros\Response\EmitterInterface` and the various emitter implementations.
  These can now be found in the package [laminas/laminas-httphandlerrunner](https://docs.laminas.dev/laminas-httphandlerrunner/), which also provides
  a PSR-7-implementation agnostic way of using them.

Fixed
-----

- Nothing.
Assets 2
Loading