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

Commit

Permalink
Support disallow_silence (#21)
Browse files Browse the repository at this point in the history
* Make fbexpect meet `disallow_silence`

* Enable strict options that introduce test failures

* Require HHVM 4.25 for HHI support of array_literal
  • Loading branch information
lexidor authored and jjergus committed Oct 31, 2019
1 parent eb36e64 commit 16b1017
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .hhconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ disallow_unsafe_comparisons=true
decl_override_require_hint=true
enable_experimental_tc_features=shape_field_check,sealed_classes
user_attributes=

; Once the minimum hhvm version hits 4.25 this setting can be safely enabled
disallow_array_literal = false
disallow_array_literal = true
disallow_silence = true
17 changes: 11 additions & 6 deletions src/Constraint/IsType.hack
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ class IsType {
'array' => ($x ==> \is_array($x)),
'object' => ($x ==> \is_object($x)),
'resource' => (
$x ==> ($x is resource) ||
(
@\get_resource_type(
/* HH_FIXME[4110] closed resources fail is resource */ $x,
) is string
)
$x ==> {
if ($x is resource) {
return true;
}
$error_level = \error_reporting(0);
$is_resource = \get_resource_type(
/* HH_FIXME[4110] closed resources fail is resource */ $x,
) is string;
\error_reporting($error_level);
return $is_resource;
}
),
'scalar' => ($x ==> \is_scalar($x)),
'callable' => ($x ==> \is_callable($x)),
Expand Down

0 comments on commit 16b1017

Please sign in to comment.