psg / psr-100-implementation
A fast PHP7 implementation of PSR-100
0.2
2021-07-11 23:27 UTC
Requires
- php: >=7.1
- php-http/message-factory: ^1.0
- psg/psr-100: ^0.2.0
- psr/http-message: ^1.0
Requires (Dev)
- http-interop/http-factory-tests: ^0.9
- php-http/psr7-integration-tests: ^1.0
- phpunit/phpunit: ^7.5 || 8.5 || 9.4
- symfony/error-handler: ^4.4
Provides
This package is auto-updated.
Last update: 2024-10-12 06:54:31 UTC
README
See Nyholm/psr7
In porting Nyholm/psr7, some issues came up:
- can't extend an interface and overwrite a method with a method taking an extended interface type:
interface x{ public function bob(); } interface y extends x{ public function bill(); } interface bob{ public function process(x $bob); } interface sue extends bob{ public function process(y $bob); }
- But I can extend with different return values
interface x{ public function bob(); } interface y extends x{ public function bill(); } interface bob{ public function process(x $bob): x; } interface sue extends bob{ public function process(x $bob): y; }
- same case with
implement
. As such, original Psr interfaces are used where necessary. - since PHP does not offer the ability to have a static and non-static method of the same name, Stream::create, which interferes with the new interface, has become Stream::defaultCreate. Here, the concept is, the static version of create will use a default configuration for stream creation.
- tests written for Response to accept status string, but status typed as int in __construct. Remove int type declaration.
- error occurs in phpunit tests on tests/UploadedFileTest.php cleanup when \file_exists encounters non-string. Conformed input to string.