Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3c2488b

Browse files
Add explicit callback for array_filter
1 parent 0087056 commit 3c2488b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎src/Type/ModelFetchedReturnTypeHelper.php‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,13 @@ private function getArrayReturnType(ClassReflection $classReflection, Scope $sco
108108
return new ConstantArrayType([], []);
109109
}
110110

111-
$fields = array_filter(array_map(
112-
static fn (Type $type) => current($type->getConstantStrings()),
113-
current($fieldsTypes)->getValueTypes()
114-
));
111+
$fields = array_filter(
112+
array_map(
113+
static fn (Type $type) => current($type->getConstantStrings()),
114+
current($fieldsTypes)->getValueTypes()
115+
),
116+
static fn (ConstantStringType|false $constantStringType): bool => $constantStringType !== false
117+
);
115118

116119
return new ConstantArrayType(
117120
$fields,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /