diff --git a/.travis.yml b/.travis.yml index 21f3d35..c7129ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ sudo: required language: generic services: docker env: -- HHVM_VERSION=latest - HHVM_VERSION=nightly install: - docker pull hhvm/hhvm:$HHVM_VERSION diff --git a/composer.json b/composer.json index 69d5332..a6ce45c 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,6 @@ }, "require-dev": { "hhvm/hhvm-autoload": "^2.0", - "hhvm/hhast": "^4.0" + "hhvm/hhast": "^4.1" } } diff --git a/composer.lock b/composer.lock index be995ba..9f20a99 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a643b2edb9bf4064ff9576471565d917", + "content-hash": "930a83f29f9b0fb8b77ef5ca13c0409f", "packages": [ { "name": "facebook/difflib", @@ -282,22 +282,22 @@ "packages-dev": [ { "name": "hhvm/hhast", - "version": "v4.0.5", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/hhvm/hhast.git", - "reference": "a5e7f731dcc73846b500062f52abfb58d575be13" + "reference": "b3933992f65e948dd600ed9a4fbef508388ce7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hhvm/hhast/zipball/a5e7f731dcc73846b500062f52abfb58d575be13", - "reference": "a5e7f731dcc73846b500062f52abfb58d575be13", + "url": "https://api.github.com/repos/hhvm/hhast/zipball/b3933992f65e948dd600ed9a4fbef508388ce7ed", + "reference": "b3933992f65e948dd600ed9a4fbef508388ce7ed", "shasum": "" }, "require": { "facebook/difflib": "^1.0.0", "facebook/hh-clilib": "^2.0.0", - "hhvm": "^4.0", + "hhvm": "^4.1", "hhvm/hhvm-autoload": "^2.0.4", "hhvm/hsl": "^4.0", "hhvm/type-assert": "^3.1" @@ -309,8 +309,11 @@ }, "bin": [ "bin/hhast-lint", + "bin/hhast-lint.hack", "bin/hhast-inspect", - "bin/hhast-migrate" + "bin/hhast-inspect.hack", + "bin/hhast-migrate", + "bin/hhast-migrate.hack" ], "type": "library", "extra": { @@ -322,7 +325,7 @@ "license": [ "MIT" ], - "time": "2019-03-06T18:49:34+00:00" + "time": "2019-03-11T21:30:03+00:00" } ], "aliases": [], diff --git a/src/Assert.hack b/src/Assert.hack index 7b7d6c0..e8ca28b 100644 --- a/src/Assert.hack +++ b/src/Assert.hack @@ -512,7 +512,7 @@ abstract class Assert { if ($actual is KeyedContainer<_, _>) { $actual_value = idx($actual, $key ?as arraykey); $part = '['.\var_export($key, true).']'; - } else if (is_object($actual)) { + } else if (\is_object($actual)) { $actual_value = /* UNSAFE_EXPR */ $actual->$key; $part = "->".$key; } else { @@ -520,7 +520,7 @@ abstract class Assert { $part = null; } - if (is_any_array($value) || is_object($value)) { + if (is_any_array($value) || \is_object($value)) { $this->assertSubset($value, $actual_value, $msg, $path.$part); } else { $this->assertEquals($value, $actual_value, $msg."\nKey: ".$path.$part); diff --git a/src/ExpectObj.hack b/src/ExpectObj.hack index a91be83..714e2a9 100644 --- a/src/ExpectObj.hack +++ b/src/ExpectObj.hack @@ -295,7 +295,7 @@ class ExpectObj extends Assert { /* HH_FIXME[4110] KeyedContainer<_, _> always has arraykey keys */ $this->assertKeyAndValueEquals( $expected as KeyedContainer<_, _>, - is_array($value) ? $value : [], + \is_array($value) ? $value : [], $msg, ); } diff --git a/src/utils.hack b/src/utils.hack index 0188187..168212c 100644 --- a/src/utils.hack +++ b/src/utils.hack @@ -11,7 +11,7 @@ namespace Facebook\FBExpect; function is_any_array(mixed $value): bool { return ( - is_array($value) || + \is_array($value) || ($value is dict<_, _>) || ($value is vec<_>) || ($value is keyset<_>) @@ -19,7 +19,7 @@ function is_any_array(mixed $value): bool { } function not_hack_array(mixed $value): mixed { - if (is_any_array($value) && !is_array($value)) { + if (is_any_array($value) && !\is_array($value)) { /* HH_IGNORE_ERROR[4007] sketchy array cast */ return (array) $value; } @@ -27,14 +27,14 @@ function not_hack_array(mixed $value): mixed { } function print_type(mixed $value): string { - if (is_object($value)) { + if (\is_object($value)) { return \get_class($value); } return \gettype($value); } function is_iterable(mixed $value): bool { - return is_array($value) || (is_object($value) && ($value instanceof Traversable)); + return \is_array($value) || (\is_object($value) && ($value instanceof Traversable)); } function is_type(mixed $value): bool {