1 | <?php |
||
12 | class ProvidersContainer implements ProvidersContainerInterface |
||
13 | { |
||
14 | /** |
||
15 | * References to the request and response classes that travels |
||
16 | * through the application |
||
17 | * |
||
18 | * @var RequestInterface |
||
19 | */ |
||
20 | protected $request; |
||
21 | /** |
||
22 | * @var ResponseInterface |
||
23 | */ |
||
24 | protected $response; |
||
25 | |||
26 | const PROVIDERS_NAMESPACE = "seregazhuk\\PinterestBot\\Api\\Providers\\"; |
||
27 | |||
28 | /** |
||
29 | * A array containing the cached providers |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | private $providers = []; |
||
34 | |||
35 | public function __construct(RequestInterface $request, ResponseInterface $response) |
||
40 | |||
41 | /** |
||
42 | * @param string $provider |
||
43 | * @return Provider |
||
44 | * @throws WrongProviderException |
||
45 | */ |
||
46 | public function getProvider($provider) |
||
57 | |||
58 | /** |
||
59 | * @param string $provider |
||
60 | * @throws WrongProviderException |
||
61 | */ |
||
62 | private function addProvider($provider) |
||
76 | |||
77 | /** |
||
78 | * @return RequestInterface |
||
79 | */ |
||
80 | public function getRequest() |
||
84 | |||
85 | /** |
||
86 | * @return ResponseInterface |
||
87 | */ |
||
88 | public function getResponse() |
||
92 | } |