Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 5308 | public function getIndexes(string $entity): array |
|
25 | { |
||
26 | 5308 | if (isset($this->indexes[$entity])) { |
|
27 | 3918 | return $this->indexes[$entity]; |
|
28 | } |
||
29 | |||
30 | 5308 | $pk = $this->schema->define($entity, SchemaInterface::PRIMARY_KEY); |
|
31 | 5308 | $keys = $this->schema->define($entity, SchemaInterface::FIND_BY_KEYS) ?? []; |
|
32 | |||
33 | 5308 | return $this->indexes[$entity] = \array_unique(\array_merge([$pk], $keys), SORT_REGULAR); |
|
34 | } |
||
36 |