| 1 | <?php |
||
| 7 | abstract class AbstractMapper |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * implements the mapping of parts |
||
| 11 | * |
||
| 12 | * @param array $parts - the name parts |
||
| 13 | * @return array $parts - the mapped parts |
||
| 14 | */ |
||
| 15 | abstract public function map(array $parts); |
||
| 16 | |||
| 17 | /** |
||
| 18 | * checks if there are still unmapped parts left before the given position |
||
| 19 | * |
||
| 20 | * @param array $parts |
||
| 21 | * @param $index |
||
| 22 | * @return bool |
||
| 23 | */ |
||
| 24 | protected function hasUnmappedPartsBefore(array $parts, $index): bool |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param string $type |
||
| 41 | * @param array $parts |
||
| 42 | * @return int|bool |
||
| 43 | */ |
||
| 44 | protected function findFirstMapped(string $type, array $parts) |
||
| 56 | |||
| 57 | /** |
||
| 58 | * get the registry lookup key for the given word |
||
| 59 | * |
||
| 60 | * @param string $word the word |
||
| 61 | * @return string the key |
||
| 62 | */ |
||
| 63 | protected function getKey($word): string |
||
| 67 | } |
||
| 68 |