11<?php
22
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+ * @link https://github.com/php-fast-forward/http
12+ * @copyright Copyright (c) 2025 Felipe Sayão Lobato Abreu <[email protected] > 13+ * @license https://opensource.org/licenses/MIT MIT License
14+ */
15+
316namespace FastForward \Http \ServiceProvider ;
417
518use FastForward \Container \ServiceProvider \AggregateServiceProvider ;
619use FastForward \Http \Client \ServiceProvider \HttpClientServiceProvider ;
720use FastForward \Http \Message \Factory \ServiceProvider \HttpMessageFactoryServiceProvider ;
821use Interop \Container \ServiceProviderInterface ;
922
23+ /**
24+ * Class HttpServiceProvider
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+ */
1032final class HttpServiceProvider implements ServiceProviderInterface
1133{
34+ /**
35+ * @var ServiceProviderInterface The aggregate service provider that includes all HTTP service providers.
36+ */
1237 private ServiceProviderInterface $ serviceProvider ;
1338
39+ /**
40+ * Constructs the HttpServiceProvider.
41+ *
42+ * This constructor MUST initialize the internal service provider as an instance of
43+ * AggregateServiceProvider composed of HTTP-related service providers.
44+ */
1445 public function __construct ()
1546 {
1647 $ this ->serviceProvider = new AggregateServiceProvider (
@@ -19,11 +50,25 @@ public function __construct()
1950 );
2051 }
2152
53+ /**
54+ * Returns an array of factory callables provided by the aggregate service provider.
55+ *
56+ * This method MUST delegate the call to the internal AggregateServiceProvider.
57+ *
58+ * @return array<string, callable> A map of service identifiers to factory callables.
59+ */
2260 public function getFactories (): array
2361 {
2462 return $ this ->serviceProvider ->getFactories ();
2563 }
2664
65+ /**
66+ * Returns an array of service extension callables provided by the aggregate service provider.
67+ *
68+ * This method MUST delegate the call to the internal AggregateServiceProvider.
69+ *
70+ * @return array<string, callable> A map of service identifiers to extension callables.
71+ */
2772 public function getExtensions (): array
2873 {
2974 return $ this ->serviceProvider ->getExtensions ();
0 commit comments