mirror of
https://github.com/captn3m0/india-pincode-regex.git
synced 2024-09-21 00:57:09 +00:00
[php] Fix 7.2 tests
This commit is contained in:
parent
794f82a4e2
commit
86e276b81c
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -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:
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user