| Total Complexity | 5 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class IndexParser extends Index |
||
| 9 | { |
||
| 10 | private Index $index; |
||
| 11 | private string $tableName; |
||
| 12 | |||
| 13 | public function __construct(Index $index, string $tableName) |
||
| 17 | } |
||
| 18 | |||
| 19 | public function getField(): array |
||
| 20 | { |
||
| 21 | return $this->index->fields; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function getName(): string |
||
| 25 | { |
||
| 26 | return $this->index->name |
||
| 27 | ?? sprintf('%s_%s_index', $this->tableName, implode('_', $this->getField())); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function isUnique(): bool |
||
| 31 | { |
||
| 32 | return $this->index->unique; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function getOptions(): array |
||
| 40 | ]; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |