zendframework / zend-stratigility

Middleware for PHP built on top of PSR-7 and PSR-15
BSD 3-Clause "New" or "Revised" License
235 stars 57 forks source link

Http Response method withStatus not compatible with Psr Interface #182

Closed RyseSlade closed 5 years ago

RyseSlade commented 5 years ago

zend-stratigility 1.3.3

Zend\Stratigility\Http\Response method withStatus is not compatible with Interface Psr\Http\Message\ResponseInterface. Second parameter $reasonPhrase should default to empty string but defaults to null. zend-diactoros added a string check in method setStatusCode that throws an InvalidArgumentException when $reasonPhrase is not a string.

weierophinney commented 5 years ago

The version 1 series is no longer supported. Please upgrade to version 2.2 (LTS version) or 3.0 (stable version). These versions no longer implement the PSR-7 wrappers, making the point moot.

RyseSlade commented 5 years ago

I just want to note this breaks applications using zend-expressive 1.x because zend-expressive relies on zend-diactoros and zend-stratigility. While I do understand v1.x is discontinued - zend-diactoros 1.x was changed recently (https://github.com/zendframework/zend-diactoros/pull/320). That change causes applications to malfunction.

weierophinney commented 5 years ago

Expressive 1.x is also no longer supported; the current oldest LTS is 2.2. Please see https://framework.zend.com/long-term-support

You can always pin your application to earlier versions of libraries by either explicitly requiring them with appropriate constraints, or putting in a conflicts rule in your application package to prevent installation of newer versions.