@@ 235-251 (lines=17) @@ | ||
232 | return $translation; |
|
233 | } |
|
234 | ||
235 | private function incrementString($string, $append = '-v') |
|
236 | { |
|
237 | $finalDigitGrabberRegex = '/\d+$/'; |
|
238 | $matches = []; |
|
239 | ||
240 | preg_match($finalDigitGrabberRegex, $string, $matches); |
|
241 | ||
242 | if (count($matches) > 0) { |
|
243 | $digit = (int) $matches[0]; |
|
244 | ++$digit; |
|
245 | ||
246 | // Replace the integer with the new digit. |
|
247 | return preg_replace($finalDigitGrabberRegex, $digit, $string); |
|
248 | } else { |
|
249 | return $string . $append . '1'; |
|
250 | } |
|
251 | } |
|
252 | ||
253 | /** |
|
254 | * @param string $parentPageClass |
@@ 337-353 (lines=17) @@ | ||
334 | * |
|
335 | * @return string incremented string |
|
336 | */ |
|
337 | private function incrementString($string, $append = '-v') |
|
338 | { |
|
339 | $finalDigitGrabberRegex = '/\d+$/'; |
|
340 | $matches = []; |
|
341 | ||
342 | preg_match($finalDigitGrabberRegex, $string, $matches); |
|
343 | ||
344 | if (\count($matches) > 0) { |
|
345 | $digit = (int) $matches[0]; |
|
346 | ++$digit; |
|
347 | ||
348 | // Replace the integer with the new digit. |
|
349 | return preg_replace($finalDigitGrabberRegex, $digit, $string); |
|
350 | } |
|
351 | ||
352 | return $string . $append . '1'; |
|
353 | } |
|
354 | ||
355 | /** |
|
356 | * @return bool |