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