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

Commit 56c0b9a

Browse files
committed
Fix new hack errors in nightlies
1 parent 72d66ca commit 56c0b9a

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ sudo: required
22
language: generic
33
services: docker
44
env:
5-
- HHVM_VERSION=latest
65
- HHVM_VERSION=nightly
76
install:
87
- docker pull hhvm/hhvm:$HHVM_VERSION

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
},
1111
"require-dev": {
1212
"hhvm/hhvm-autoload": "^2.0",
13-
"hhvm/hhast": "^4.0"
13+
"hhvm/hhast": "^4.1"
1414
}
1515
}

composer.lock

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Assert.hack

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,15 +512,15 @@ abstract class Assert {
512512
if ($actual is KeyedContainer<_, _>) {
513513
$actual_value = idx($actual, $key ?as arraykey);
514514
$part = '['.\var_export($key, true).']';
515-
} else if (is_object($actual)) {
515+
} else if (\is_object($actual)) {
516516
$actual_value = /* UNSAFE_EXPR */ $actual->$key;
517517
$part = "->".$key;
518518
} else {
519519
$actual_value = null;
520520
$part = null;
521521
}
522522

523-
if (is_any_array($value) || is_object($value)) {
523+
if (is_any_array($value) || \is_object($value)) {
524524
$this->assertSubset($value, $actual_value, $msg, $path.$part);
525525
} else {
526526
$this->assertEquals($value, $actual_value, $msg."\nKey: ".$path.$part);

src/ExpectObj.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class ExpectObj<T> extends Assert {
295295
/* HH_FIXME[4110] KeyedContainer<_, _> always has arraykey keys */
296296
$this->assertKeyAndValueEquals(
297297
$expected as KeyedContainer<_, _>,
298-
is_array($value) ? $value : [],
298+
\is_array($value) ? $value : [],
299299
$msg,
300300
);
301301
}

src/utils.hack

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@ namespace Facebook\FBExpect;
1111

1212
function is_any_array(mixed $value): bool {
1313
return (
14-
is_array($value) ||
14+
\is_array($value) ||
1515
($value is dict<_, _>) ||
1616
($value is vec<_>) ||
1717
($value is keyset<_>)
1818
);
1919
}
2020

2121
function not_hack_array(mixed $value): mixed {
22-
if (is_any_array($value) && !is_array($value)) {
22+
if (is_any_array($value) && !\is_array($value)) {
2323
/* HH_IGNORE_ERROR[4007] sketchy array cast */
2424
return (array) $value;
2525
}
2626
return $value;
2727
}
2828

2929
function print_type(mixed $value): string {
30-
if (is_object($value)) {
30+
if (\is_object($value)) {
3131
return \get_class($value);
3232
}
3333
return \gettype($value);
3434
}
3535

3636
function is_iterable(mixed $value): bool {
37-
return is_array($value) || (is_object($value) && ($value instanceof Traversable));
37+
return \is_array($value) || (\is_object($value) && ($value instanceof Traversable));
3838
}
3939

4040
function is_type(mixed $value): bool {

0 commit comments

Comments
 (0)