Skip to content

Commit

Permalink
Update array_filter signature to allow null as callback
Browse files Browse the repository at this point in the history
  • Loading branch information
andyexeter committed Nov 15, 2023
1 parent 32f7081 commit 41ffb3d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/Reflection/ParametersAcceptorSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,16 @@ public static function selectFromArgs(
$parameters[1] = new NativeParameterReflection(
$parameters[1]->getName(),
$parameters[1]->isOptional(),
new CallableType(
$arrayFilterParameters ?? [
new DummyParameter('item', $scope->getIterableValueType($scope->getType($args[0]->value)), false, PassedByReference::createNo(), false, null),
],
new MixedType(),
false,
),
new UnionType([
new CallableType(
$arrayFilterParameters ?? [
new DummyParameter('item', $scope->getIterableValueType($scope->getType($args[0]->value)), false, PassedByReference::createNo(), false, null),
],
new MixedType(),
false,
),
new NullType(),
]),
$parameters[1]->passedByReference(),
$parameters[1]->isVariadic(),
$parameters[1]->getDefaultValue(),
Expand Down

0 comments on commit 41ffb3d

Please sign in to comment.