Kaspi/http-message is a lightweight implementation PSR-7, PSR-17 for >= PHP 8.1
Implementation of PSR-17:
\Kaspi\HttpMessage\HttpFactory::class
Implementation of PSR-7:
\Kaspi\HttpMessage\Message::class\Kaspi\HttpMessage\Request::class\Kaspi\HttpMessage\Response::class\Kaspi\HttpMessage\ServerRequest::class\Kaspi\HttpMessage\Stream::class\Kaspi\HttpMessage\UploadedFile::class\Kaspi\HttpMessage\Uri::class
Additional implementations for \Psr\Http\Message\StreamInterface
\Kaspi\HttpMessage\Stream\FileStream::class\Kaspi\HttpMessage\Stream\PhpMemoryStream::class\Kaspi\HttpMessage\Stream\PhpTempStream::class
composer require kaspi/http-message- Local development (without Docker)
- With Docker images (WSL, Linux)
Required PHP 8.1, php Composer
Run test without code coverage
composer testRunning tests with checking code coverage by tests with a report in html format
./vendor/bin/pest --compactRequires installed PCOV driver
⛑ the results will be in the folder .coverage-html
For static analysis we use the package Phan.
Running without PHP extension PHP AST
./vendor/bin/phan --allow-polyfill-parserTo bring the code to standards, we use php-cs-fixer which is declared in composer's dev dependencies
composer fixerYou can specify the image with the PHP version in the .env file in the PHP_IMAGE key.
By default, the container is built with the php:8.1-cli-alpine image.
Build docker container
docker-compose buildInstall php composer dependencies:
docker-compose run --rm php composer installRun tests with a code coverage report and a report in html format
docker-compose run --rm php vendor/bin/pest --compact⛑ the results will be in the folder .coverage-html
Phan (static analyzer for PHP)
docker-compose run --rm php vendor/bin/phanYou can work in a shell in a docker container:
docker-compose run --rm php shCheck and correct code style:
make fixRun the static code analyzer:
make statRun tests:
make testRun all stages of checks:
make allRun tests for all support PHP versions:
make test-supports-php