[php] Fix 7.2 tests

This commit is contained in:
Nemo 2023-07-02 14:50:58 +05:30
parent 794f82a4e2
commit 86e276b81c
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ jobs:
php-version: ${{matrix.php}}
tools: phpunit, composer
- run: composer install --no-interaction
- run: ./vendor/bin/phpunit --migrate-configuration
- run: ./vendor/bin/phpunit
ruby:
strategy:
matrix:

View File

@ -43,13 +43,13 @@ class Validator {
preg_match_all($regex, $address, $matches);
$results = array_reduce($matches, function($res, $match) {
if ($match[0] and in_array($match[0], $res, true) === false){
if (isset($match[0]) and in_array($match[0], $res, true) === false){
$res[] = $match[0];
}
return $res;
}, $results);
}
return $results;
return array_values($results);
}
}