Skip to content

Commit 566a177

Browse files
committed
drop support for old hhvm version
1 parent 8dd4040 commit 566a177

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

.hhconfig

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ const_default_func_args = true
66
disallow_array_literal = true
77
disable_lval_as_an_expression = true
88
ignored_paths = [ "vendor/.+/tests/.+", "vendor/.+/bin/.+" ]
9+
allowed_decl_fixme_codes=2053,4045,4047
10+
allowed_fixme_codes_strict=2011,2049,2050,2053,2083,3084,4027,4045,4047,4104,4106,4107,4108,4110,4128,4135,4188,4200,4223,4248,4240,4323

composer.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414
}
1515
],
1616
"require": {
17-
"hhvm": "^4.25",
18-
"hhvm/type-assert": "^3.6"
17+
"hhvm": "~4.83.1 || ~4.84.0",
18+
"hhvm/type-assert": "^4.1.2"
1919
},
2020
"require-dev": {
21-
"facebook/fbexpect": "^2.7",
21+
"facebook/difflib": "^1.1.1",
22+
"facebook/fbexpect": "^2.7.7",
23+
"facebook/hh-clilib": "^2.5.2",
2224
"hhvm/hacktest": "^2.0",
23-
"hhvm/hhast": "^4.25"
25+
"hhvm/hhast": "^4.82.2",
26+
"hhvm/hhvm-autoload": "^3.1.6",
27+
"hhvm/type-assert": "^4.1.2"
2428
},
2529
"scripts": {
2630
"check": [

src/Nuxed/Json/decode.hack

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ function decode(string $json, bool $assoc = true): dynamic {
99
$json,
1010
$assoc,
1111
512,
12-
\JSON_BIGINT_AS_STRING | \JSON_FB_HACK_ARRAYS,
12+
\JSON_BIGINT_AS_STRING |
13+
(
14+
\defined('JSON_FB_HACK_ARRAYS')
15+
? \constant('\JSON_FB_HACK_ARRAYS')
16+
: 0
17+
),
1318
);
1419
} catch (\Throwable $e) {
1520
// assoc = true & invalid property name results in `\Error`

src/Nuxed/Json/encode.hack

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function encode(mixed $value, bool $pretty = false, int $flags = 0): string {
77
$flags |= \JSON_UNESCAPED_UNICODE |
88
\JSON_UNESCAPED_SLASHES |
99
\JSON_PRESERVE_ZERO_FRACTION;
10+
1011
if ($pretty) {
1112
$flags |= \JSON_PRETTY_PRINT;
1213
}

src/Nuxed/Json/spec.hack

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use namespace Facebook\{TypeAssert, TypeSpec};
77
*/
88
function spec<T>(string $json, TypeSpec\TypeSpec<T> $spec): T {
99
$value = decode($json);
10+
1011
try {
1112
return $spec->assertType($value);
1213
} catch (TypeAssert\IncorrectTypeException $e) {

0 commit comments

Comments
 (0)