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 | /** |
||
23 | * @var ResponseInterface |
||
24 | */ |
||
25 | protected $response; |
||
26 | |||
27 | const PROVIDERS_NAMESPACE = "seregazhuk\\PinterestBot\\Api\\Providers\\"; |
||
28 | |||
29 | /** |
||
30 | * A array containing the cached providers |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | private $providers = []; |
||
35 | |||
36 | public function __construct(RequestInterface $request, ResponseInterface $response) |
||
41 | |||
42 | /** |
||
43 | * @param string $provider |
||
44 | * @return Provider |
||
45 | * @throws WrongProviderException |
||
46 | */ |
||
47 | public function getProvider($provider) |
||
56 | |||
57 | /** |
||
58 | * @param string $provider |
||
59 | * @throws WrongProviderException |
||
60 | */ |
||
61 | private function addProvider($provider) |
||
75 | |||
76 | /** |
||
77 | * @return RequestInterface |
||
78 | */ |
||
79 | public function getRequest() |
||
83 | |||
84 | /** |
||
85 | * @return ResponseInterface |
||
86 | */ |
||
87 | public function getResponse() |
||
91 | } |