Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
support and require HHVM 4.45
Browse files Browse the repository at this point in the history
don't use array functions that were added later (e.g. is_any_array)
  • Loading branch information
jjergus committed Aug 17, 2020
1 parent 2cecd71 commit 1282974
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: required
language: generic
services: docker
env:
- HHVM_VERSION=4.25-latest
- HHVM_VERSION=4.45-latest
- HHVM_VERSION=latest
- HHVM_VERSION=nightly
install:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Unit test helpers for Facebook projects",
"license": "MIT",
"require": {
"hhvm": "^4.25",
"hhvm": "^4.45",
"hhvm/hacktest": "^1.0|^2.0",
"hhvm/hsl": "^4.0",
"facebook/difflib": "^1.0.0"
Expand Down
8 changes: 6 additions & 2 deletions src/utils.hack
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
namespace Facebook\FBExpect;

function is_any_array(mixed $value): bool {
return \HH\is_any_array($value);
return
\HH\is_php_array($value) ||
($value is dict<_, _>) ||
($value is vec<_>) ||
($value is keyset<_>);
}

function print_type(mixed $value): string {
Expand All @@ -21,7 +25,7 @@ function print_type(mixed $value): string {
}

function is_iterable(mixed $value): bool {
return \HH\is_any_array($value) ||
return is_any_array($value) ||
(\is_object($value) && ($value is Traversable<_>));
}

Expand Down

0 comments on commit 1282974

Please sign in to comment.