Conditions | 5 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function __construct(array $resources) |
||
16 | { |
||
17 | foreach ($resources as $resource) |
||
18 | { |
||
19 | if (gettype($resource) === 'string' && class_exists($resource)) { |
||
20 | $this->static[] = $resource; |
||
21 | continue; |
||
22 | } |
||
23 | if ($resource instanceof ApiResourcesInterface) { |
||
24 | $this->chainedResources[] = $resource; |
||
25 | continue; |
||
26 | } |
||
27 | throw new BadConfigurationException('I expect to get a list of classes or ApiResourcesInterface instances.'); |
||
28 | } |
||
40 |