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

Commit 16feaf0

Browse files
jjergususox
authored andcommitted
replace all legacy array references
1 parent 0f217a3 commit 16feaf0

4 files changed

Lines changed: 5 additions & 7 deletions

File tree

.hhconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ safe_array = true
3737
safe_vector_array = true
3838
typecheck_xhp_cvars = true
3939
unsafe_rx = false
40+
allowed_decl_fixme_codes=2053,4047
41+
allowed_fixme_codes_strict=2011,2049,2050,2053,4026,4027,4047,4053,4104,4107,4108,4110,4128,4135,4188,4200,4240,4248,4323

src/Mock/Param/ParamGeneratorDefaultValue.hh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@ final class ParamGeneratorDefaultValue implements ParamGeneratorInterface {
2222
$param->getDefaultValue(),
2323
);
2424
} else {
25-
$default_value = $param->getDefaultValue();
26-
if (\is_array($default_value)) {
27-
$default_value = '[]';
28-
}
2925
$method->addParameterf(
3026
'%s $%s = %s',
3127
$param_type_hint,
3228
$param->getName(),
33-
$default_value,
29+
$param->getDefaultValueText(),
3430
);
3531
}
3632
}

src/functions.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function vec_to_string(vec<mixed> $data): string {
8686
if (\is_object($param)) {
8787
return \get_class($param);
8888
}
89-
if (\is_array($param)) {
89+
if ($param is Traversable<_>) {
9090
return vec_to_string(vec($param));
9191
}
9292
return (string) $param;

tests/Stub/DefaultValueClass.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class DefaultValueClass {
2323

2424
}
2525

26-
public function defaultNullArray(?array<arraykey, mixed> $param = null): void {
26+
public function defaultNullArray(?KeyedContainer<arraykey, mixed> $param = null): void {
2727

2828
}
2929

0 commit comments

Comments
 (0)