@@ 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 |
@@ 134-145 (lines=12) @@ | ||
131 | * @param $startIndex |
|
132 | * @return int|void |
|
133 | */ |
|
134 | protected function skipNicknameParts($parts, $startIndex) |
|
135 | { |
|
136 | $total = count($parts); |
|
137 | ||
138 | for ($i = $startIndex; $i < $total; $i++) { |
|
139 | if (!($parts[$i] instanceof Nickname)) { |
|
140 | return $i; |
|
141 | } |
|
142 | } |
|
143 | ||
144 | return $total - 1; |
|
145 | } |
|
146 | } |
|
147 |