Skip to content

Commit

Permalink
Merge pull request #12 from seisigmasrl/fix/utils
Browse files Browse the repository at this point in the history
FIX - getNumbersFromString to correctly return all numbers.
  • Loading branch information
ricardov03 authored Feb 9, 2023
2 parents 0cd3ee7 + 66aaac3 commit 872188c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ final class Utils
{
private function getNumbersFromString(string $string): string|bool
{
preg_match('/\d+/', $string, $matches);
preg_match_all('/\d+/', $string, $matches);

return count($matches) ? $matches[0] : false;
return count($matches[0]) ? implode($matches[0]) : false;
}

public static function getNumbers(string $string): string|bool
Expand Down

0 comments on commit 872188c

Please sign in to comment.