Total Complexity | 6 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | class ApiResourcesFromNamespace implements ApiResourcesInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $namespace; |
||
19 | |||
20 | public function __construct(string $namespace) |
||
21 | { |
||
22 | // @codeCoverageIgnoreStart |
||
23 | if (!class_exists(ClassFinder::class)) { |
||
24 | throw new BadConfigurationException(__CLASS__ . ' can only be used if you require haydenpierce/class-finder in your project.'); |
||
25 | } |
||
26 | // @codeCoverageIgnoreEnd |
||
27 | $this->namespace = $namespace; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * Returns all api resources. |
||
32 | * |
||
33 | * @return string[] |
||
34 | */ |
||
35 | public function getApiResources(): array |
||
38 | } |
||
39 | |||
40 | public static function createApiResources(string $namespace, bool $defaultResources = true): array |
||
53 | } |
||
54 | } |
||
55 |