| @@ 45-56 (lines=12) @@ | ||
| 42 | * @param array $parts |
|
| 43 | * @return int|bool |
|
| 44 | */ |
|
| 45 | protected function findFirstMapped(string $type, array $parts) |
|
| 46 | { |
|
| 47 | $total = count($parts); |
|
| 48 | ||
| 49 | for ($i = 0; $i < $total; $i++) { |
|
| 50 | if ($parts[$i] instanceof $type) { |
|
| 51 | return $i; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| 55 | return false; |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * get the registry lookup key for the given word |
|
| @@ 199-210 (lines=12) @@ | ||
| 196 | * @param $startIndex |
|
| 197 | * @return int|void |
|
| 198 | */ |
|
| 199 | protected function skipNicknameParts($parts, $startIndex) |
|
| 200 | { |
|
| 201 | $total = count($parts); |
|
| 202 | ||
| 203 | for ($i = $startIndex; $i < $total; $i++) { |
|
| 204 | if (!($parts[$i] instanceof Nickname)) { |
|
| 205 | return $i; |
|
| 206 | } |
|
| 207 | } |
|
| 208 | ||
| 209 | return $total - 1; |
|
| 210 | } |
|
| 211 | } |
|
| 212 | ||