sauber-php / http
The HTTP component for the Sauber PHP framework
Fund package maintenance!
juststeveking
Requires
- php: ^8.1
- juststeveking/http-status-code: ^2.0
- laminas/laminas-diactoros: ^2.11
- laminas/laminas-httphandlerrunner: ^2.1
- league/route: ^5.1
- psr/container: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8
- pestphp/pest: ^1.21
- phpstan/phpstan: ^1.7
This package is not auto-updated.
Last update: 2024-11-09 23:48:31 UTC
README
Http Component
This is the repository for the HTTP Component used in the Sauber PHP Framework.
Installation
You should not need to install this package, as it comes pre-installed with the Sauber PHP Framework, however if you want to use this outside of the framework please use composer:
composer require sauber-php/http
Usage
To use the component, you can instantiate with your own container and add routes:
$router = new Router( container: new Container(), ); $router->middleware( middleware: new PSR15Middleware(), ); $router->get( path: '/', handler: fn () => ['test' => time()], ); $router->handle( request: Request::capture(), );
Testing
To run the tests:
./vendor/bin/pest
Static Analysis
To check the static analysis:
./vendor/bin/phpstan analyse
Changelog
Please see the Changelog for more information on what has changed recently.