Conditions | 7 |
Paths | 10 |
Total Lines | 24 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function create(string $resourceClass, array $options = []): PropertyNameCollection |
||
39 | { |
||
40 | $propertyNames = []; |
||
41 | |||
42 | // Inherited from parent |
||
43 | if ($this->decorated) { |
||
44 | foreach ($this->decorated->create($resourceClass, $options) as $propertyName) { |
||
45 | $propertyNames[$propertyName] = (string) $propertyName; |
||
46 | } |
||
47 | } |
||
48 | |||
49 | foreach ($this->resourceNameCollection->create() as $knownResourceClass) { |
||
50 | if ($resourceClass === $knownResourceClass) { |
||
51 | continue; |
||
52 | } |
||
53 | |||
54 | if (is_subclass_of($knownResourceClass, $resourceClass)) { |
||
55 | foreach ($this->create($knownResourceClass) as $propertyName) { |
||
56 | $propertyNames[$propertyName] = $propertyName; |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 | |||
61 | return new PropertyNameCollection(array_values($propertyNames)); |
||
62 | } |
||
64 |