Total Complexity | 5 |
Total Lines | 72 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class ApplicationInfoRetriever implements ApiResourceRetrieverInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $appName; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $environment; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $hash; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | private $debug; |
||
33 | |||
34 | /** |
||
35 | * @param string $appName |
||
36 | * @param string $environment |
||
37 | * @param string $hash |
||
38 | * @param bool $debug |
||
39 | */ |
||
40 | public function __construct(string $appName, string $environment, string $hash, bool $debug) |
||
41 | { |
||
42 | $this->appName = $appName; |
||
43 | $this->environment = $environment; |
||
44 | $this->hash = $hash; |
||
45 | $this->debug = $debug; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param string $resourceClass |
||
50 | * @param string $id |
||
51 | * @param array $context |
||
52 | * @return ApplicationInfo |
||
53 | */ |
||
54 | public function retrieve(string $resourceClass, $id, array $context) |
||
55 | { |
||
56 | if ($id !== 'name') { |
||
57 | throw new ResourceNotFoundException($id); |
||
58 | } |
||
59 | |||
60 | return new ApplicationInfo( |
||
61 | $this->appName, |
||
62 | $this->environment, |
||
63 | $this->hash, |
||
64 | $this->debug |
||
65 | ); |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @param string $resourceClass |
||
70 | * @param array $context |
||
71 | * @param SearchFilterRequest $searchFilterRequest |
||
72 | * @return ApplicationInfo[] |
||
73 | */ |
||
74 | public function retrieveAll( |
||
84 | } |
||
85 | } |
||
86 |