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

Commit 119ee77

Browse files
committed
Add some more ignore_errors for 3.21
1 parent d591d39 commit 119ee77

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/TypeSpec/__Private/from_type_structure.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
use namespace Facebook\TypeAssert;
1818

1919
function from_type_structure<T>(TypeStructure<T> $ts): TypeSpec<T> {
20+
/* HH_IGNORE_ERROR[4108] 3.21 is not aware of optional_shape_field */
2021
if ($ts['optional_shape_field'] ?? false) {
22+
/* HH_IGNORE_ERROR[4108] 3.21 is not aware of optional_shape_field */
2123
$ts['optional_shape_field'] = false;
2224
return new OptionalSpec(from_type_structure($ts));
2325
}
@@ -114,6 +116,7 @@ function from_type_structure<T>(TypeStructure<T> $ts): TypeSpec<T> {
114116
($_k, $field_ts) ==> from_type_structure($field_ts),
115117
($k, $_v) ==> $k,
116118
),
119+
/* HH_IGNORE_ERROR[4108] 3.21 is not aware of allows_unknown_fields */
117120
($ts['allows_unknown_fields'] ?? !ShapeSpec::STRICT_SHAPES)
118121
? UnknownFieldsMode::ALLOW
119122
: UnknownFieldsMode::DENY,

tests/fixtures/TypeConstants.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class TypeConstants {
4343
const type TShapeWithOneField = shape(
4444
'someString' => string,
4545
);
46+
47+
/* HH_IGNORE_ERROR[0003] no unknown shape fields in 3.21 */
4648
const type TShapeWithOneFieldAndImplicitSubtypes = shape(
4749
'someString' => string,
4850
...

0 commit comments

Comments
 (0)