Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit d667923

Browse files
lexidorusox
authored andcommitted
Fix some hhvm 4.34 BC breaks (#11)
hhvm 4.34 compatibility
1 parent 2c9003b commit d667923

7 files changed

Lines changed: 46 additions & 13 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vendor
22
composer.lock
3+
**/*hhast.parser-cache

.hhconfig

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
1-
disallow_elvis_space=true
2-
disallow_non_arraykey_keys=true
3-
disallow_unsafe_comparisons=true
4-
decl_override_require_hint=true
5-
enable_experimental_tc_features=shape_field_check,sealed_classes
1+
assume_php = false
2+
check_attribute_locations = true
3+
check_xhp_attribute = true
4+
const_default_func_args = true
5+
decl_override_require_hint = true
6+
disable_halt_compiler = true
7+
disable_instanceof_refinement = true
8+
disable_legacy_soft_typehints = true
9+
disable_lval_as_an_expression = true
10+
disable_partially_abstract_typeconsts = true
11+
disable_primitive_refinement = true
12+
disable_static_closures = true
13+
disable_static_local_variables = true
14+
disable_unsafe_block = true
15+
disable_unsafe_expr = true
16+
disable_unset_class_const = true
17+
disallow_ambiguous_lambda = true
18+
disallow_array_literal = true
19+
disallow_byref_calls = true
20+
disallow_byref_dynamic_calls = true
21+
disallow_destruct = true
22+
disallow_elvis_space = true
23+
disallow_func_ptrs_in_constants = true
24+
disallow_invalid_arraykey = true
25+
disallow_invalid_arraykey_constraint = true
26+
disallow_non_arraykey_keys = true
27+
disallow_scrutinee_case_value_type_mismatch = true
28+
disallow_silence = true
29+
disallow_stringish_magic = true
30+
disallow_toplevel_requires = true
31+
disallow_unsafe_comparisons = true
32+
disallowed_decl_fixmes = 2049, 2050, 4002, 4041, 4049, 4050, 4052, 4055, 4057, 4068, 4077, 4080, 4085, 4086, 4090, 4104, 4105, 4106, 4300, 4337, 4352, 4366
33+
error_php_lambdas = true
34+
ignored_fixme_codes = 1001, 1002, 1003, 1004, 1005, 1006, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2023, 2024, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2044, 2045, 2046, 2047, 2048, 2051, 2052, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 3001, 3002, 3003, 3005, 3006, 3008, 3009, 3010, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 4002, 4008, 4012, 4014, 4020, 4024, 4033, 4034, 4035, 4039, 4042, 4043, 4049, 4050, 4052, 4055, 4067, 4068, 4070, 4077, 4080, 4083, 4085, 4086, 4089, 4121, 4131, 4133, 4143, 4152, 4154, 4166, 4168, 4175, 4181, 4182, 4183, 4190, 4191, 4192, 4194, 4223, 4225, 4231, 4239, 4250, 4253, 4267, 4275, 4296, 4299, 4315, 4321, 4328, 4330, 4331, 4332, 4336, 4353
35+
new_inference_lambda = true
36+
safe_array = true
37+
safe_vector_array = true
38+
typecheck_xhp_cvars = true
39+
unsafe_rx = false

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"hhvm/hsl": "^4.1",
2525
"hhvm/type-assert": "^3.2",
2626
"facebook/fbexpect": "^2.3",
27-
"hhvm/hacktest": "^1.4"
27+
"hhvm/hacktest": "^1.4|^2.0"
2828
},
2929
"require-dev": {
3030
"hhvm/hhast": "^4.1"

src/Expectation.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ final class Expectation implements ExpectationInterface {
9494
$param_expectation = $this->parameters[$key];
9595
if (\is_callable($param_expectation)) {
9696
invariant(
97-
\call_user_func($param_expectation, $param),
97+
\call_user_func($param_expectation as dynamic, $param),
9898
'Parameter validation failed'
9999
);
100100
} else {

src/Mock.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class Mock<TC> implements MockInterface {
1919

2020
/* HH_FIXME[2049] **/
2121
/* HH_FIXME[4107] **/
22-
eval(
22+
\eval(
2323
(new Mock\MockBuilder($rfl))
2424
->setName($mock_name)
2525
->get()

src/Mock/MockBuilder.hh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
namespace Usox\HackMock\Mock;
44

5-
use type Facebook\HackCodegen\CodegenClass;
6-
use type Facebook\HackCodegen\HackCodegenFactory;
7-
use type Facebook\HackCodegen\HackCodegenConfig;
5+
use type Facebook\HackCodegen\{CodegenClass, HackCodegenConfig, HackCodegenFactory};
86
use namespace HH\Lib\Str;
97

108
final class MockBuilder {
@@ -53,7 +51,7 @@ final class MockBuilder {
5351
->setReturnType('mixed')
5452
->setIsStatic($method->isStatic());
5553

56-
$param_list = [];
54+
$param_list = varray[];
5755

5856
foreach ($method->getParameters() as $param) {
5957
foreach ($this->param_generators as $generator) {

src/functions.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function process_expectation(
5454
);
5555
}
5656

57-
foreach ($expectations as $key => $expectation) {
57+
foreach ($expectations as $expectation) {
5858
try {
5959
if ($expectation->isActive() === false) {
6060
continue;

0 commit comments

Comments
 (0)