Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| HttpServiceProvider | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** |
| 6 | * This file is part of php-fast-forward/http. |
| 7 | * |
| 8 | * This source file is subject to the license bundled |
| 9 | * with this source code in the file LICENSE. |
| 10 | * |
| 11 | * @copyright Copyright (c) 2025-2026 Felipe Sayão Lobato Abreu <github@mentordosnerds.com> |
| 12 | * @license https://opensource.org/licenses/MIT MIT License |
| 13 | * |
| 14 | * @see https://github.com/php-fast-forward/http |
| 15 | * @see https://github.com/php-fast-forward |
| 16 | * @see https://datatracker.ietf.org/doc/html/rfc2119 |
| 17 | */ |
| 18 | |
| 19 | namespace FastForward\Http\ServiceProvider; |
| 20 | |
| 21 | use FastForward\Container\ServiceProvider\AggregateServiceProvider; |
| 22 | use FastForward\Http\Client\ServiceProvider\HttpClientServiceProvider; |
| 23 | use FastForward\Http\Message\Factory\ServiceProvider\HttpMessageFactoryServiceProvider; |
| 24 | |
| 25 | /** |
| 26 | * Aggregates and registers HTTP-related service providers. This class SHALL encapsulate the |
| 27 | * dependencies for HTTP client and message factory services within the container. |
| 28 | * |
| 29 | * It MUST implement the ServiceProviderInterface and MUST delegate factory and extension |
| 30 | * retrieval to the internal AggregateServiceProvider instance. |
| 31 | */ |
| 32 | final class HttpServiceProvider extends AggregateServiceProvider |
| 33 | { |
| 34 | /** |
| 35 | * Constructs the HttpServiceProvider. |
| 36 | * |
| 37 | * This constructor MUST initialize the internal service provider as an instance of |
| 38 | * AggregateServiceProvider composed of HTTP-related service providers. |
| 39 | */ |
| 40 | public function __construct() |
| 41 | { |
| 42 | parent::__construct( |
| 43 | new HttpMessageFactoryServiceProvider(), |
| 44 | new HttpClientServiceProvider(), |
| 45 | ); |
| 46 | } |
| 47 | } |