zend-diactoros 2.0.0
Added
-
#326 adds PSR-17 HTTP Message Factory implementations, including:
Zend\Diactoros\RequestFactoryZend\Diactoros\ResponseFactoryZend\Diactoros\ServerRequestFactoryZend\Diactoros\StreamFactoryZend\Diactoros\UploadedFileFactoryZend\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. -
#328 adds a package-level exception interface,
Zend\Diactoros\Exception\ExceptionInterface,
and several implementations for specific exceptions raised within the package.
These include:Zend\Diactoros\Exception\DeserializationException(extendsUnexpectedValueException)Zend\Diactoros\Exception\InvalidArgumentException(extendsInvalidArgumentException)Zend\Diactoros\Exception\InvalidStreamPointerPositionException(extendsRuntimeException)Zend\Diactoros\Exception\SerializationException(extendsUnexpectedValueException)Zend\Diactoros\Exception\UnreadableStreamException(extendsRuntimeException)Zend\Diactoros\Exception\UnrecognizedProtocolVersionException(extendsUnexpectedValueException)Zend\Diactoros\Exception\UnrewindableStreamException(extendsRuntimeException)Zend\Diactoros\Exception\UnseekableStreamException(extendsRuntimeException)Zend\Diactoros\Exception\UntellableStreamException(extendsRuntimeException)Zend\Diactoros\Exception\UnwritableStreamException(extendsRuntimeException)Zend\Diactoros\Exception\UploadedFileAlreadyMovedException(extendsRuntimeException)Zend\Diactoros\Exception\UploadedFileErrorException(extendsRuntimeException)
Changed
-
#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. -
#162 modifies
Serializer\Requestsuch that it now no longer raises anUnexpectedValueExceptionvia itstoString()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. -
#162 modifies
RequestTraitsuch that it now invalidates non-string method arguments to either
the constructor orwithMethod(), raising anInvalidArgumentExceptionfor any that do not validate.
Deprecated
- Nothing.
Removed
-
#308 removes the following methods from the
ServerRequestFactoryclass:normalizeServer()(useZend\Diactoros\normalizeServer()instead)marshalHeaders()(useZend\Diactoros\marshalHeadersFromSapi()instead)marshalUriFromServer()(useZend\Diactoros\marshalUriFromSapi()instead)marshalRequestUri()(useUri::getPath()from theUriinstance returned bymarshalUriFromSapi()instead)marshalHostAndPortFromHeaders()(useUri::getHost()andUri::getPort()from theUriinstances returned bymarshalUriFromSapi()instead)stripQueryString()(useexplode("?", $path, 2)[0]instead)normalizeFiles()(useZend\Diactoros\normalizeUploadedFiles()instead)
-
#295 removes
Zend\Diactoros\Server. You can use theRequestHandlerRunnerclass from
zendframework/zend-httphandlerrunner to provide these capabilities instead. -
#295 removes
Zend\Diactoros\Response\EmitterInterfaceand the various emitter implementations.
These can now be found in the package zendframework/zend-httphandlerrunner, which also provides
a PSR-7-implementation agnostic way of using them.
Fixed
- Nothing.