@@ 235-251 (lines=17) @@ | ||
232 | return $translation; |
|
233 | } |
|
234 | ||
235 | private function incrementString($string, $append = '-v') |
|
236 | { |
|
237 | $finalDigitGrabberRegex = '/\d+$/'; |
|
238 | $matches = array(); |
|
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 |
@@ 357-373 (lines=17) @@ | ||
354 | * |
|
355 | * @return string incremented string |
|
356 | */ |
|
357 | private function incrementString($string, $append = '-v') |
|
358 | { |
|
359 | $finalDigitGrabberRegex = '/\d+$/'; |
|
360 | $matches = []; |
|
361 | ||
362 | preg_match($finalDigitGrabberRegex, $string, $matches); |
|
363 | ||
364 | if (\count($matches) > 0) { |
|
365 | $digit = (int) $matches[0]; |
|
366 | ++$digit; |
|
367 | ||
368 | // Replace the integer with the new digit. |
|
369 | return preg_replace($finalDigitGrabberRegex, $digit, $string); |
|
370 | } |
|
371 | ||
372 | return $string.$append.'1'; |
|
373 | } |
|
374 | ||
375 | /** |
|
376 | * @return bool |