[php] Fix 7.2 tests
This commit is contained in:
parent
794f82a4e2
commit
86e276b81c
|
@ -28,7 +28,7 @@ jobs:
|
||||||
php-version: ${{matrix.php}}
|
php-version: ${{matrix.php}}
|
||||||
tools: phpunit, composer
|
tools: phpunit, composer
|
||||||
- run: composer install --no-interaction
|
- run: composer install --no-interaction
|
||||||
- run: ./vendor/bin/phpunit --migrate-configuration
|
- run: ./vendor/bin/phpunit
|
||||||
ruby:
|
ruby:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
@ -43,13 +43,13 @@ class Validator {
|
||||||
preg_match_all($regex, $address, $matches);
|
preg_match_all($regex, $address, $matches);
|
||||||
|
|
||||||
$results = array_reduce($matches, function($res, $match) {
|
$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];
|
$res[] = $match[0];
|
||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
}, $results);
|
}, $results);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return array_values($results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue