Skip to content

Commit 6cee6bb

Browse files
committed
Adds is_countable polyfill and adds extra PHP test versions
1 parent fe1a79c commit 6cee6bb

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ php:
66
- 7.0
77
- 7.1
88
- 7.2
9+
- 7.3
10+
- 7.4
911
before_script:
1012
- COMPOSER_DISCARD_CHANGES=1 composer update --prefer-dist --no-interaction --no-suggest
1113
- cp phpunit.xml.example phpunit.xml
1214
script:
13-
- vendor/bin/phpunit
15+
- vendor/bin/phpunit

src/Validate.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
use MadeSimple\Arrays\ArrDots;
66

7+
// Add polyfill in case where running in < PHP 7.3
8+
if (!function_exists('is_countable')) {
9+
function is_countable($var) {
10+
return (is_array($var) || $var instanceof Countable);
11+
}
12+
}
13+
714
class Validate
815
{
916
/**

0 commit comments

Comments
 (0)