Skip to content

Commit 9c3b765

Browse files
committed
ParametersAcceptorSelector - advanced array_map/array_filter inference only for bleeding edge
1 parent 49c9a89 commit 9c3b765

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Reflection/ParametersAcceptorSelector.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PhpParser\Node\Expr\FuncCall;
66
use PhpParser\Node\Name;
77
use PHPStan\Analyser\Scope;
8+
use PHPStan\DependencyInjection\BleedingEdgeToggle;
89
use PHPStan\Reflection\Native\NativeParameterReflection;
910
use PHPStan\Reflection\Php\DummyParameter;
1011
use PHPStan\TrinaryLogic;
@@ -48,7 +49,11 @@ public static function selectFromArgs(
4849
{
4950
$types = [];
5051
$unpack = false;
51-
if (count($args) > 0 && count($parametersAcceptors) > 0) {
52+
if (
53+
BleedingEdgeToggle::isBleedingEdge()
54+
&& count($args) > 0
55+
&& count($parametersAcceptors) > 0
56+
) {
5257
$functionName = null;
5358
$argParent = $args[0]->getAttribute('parent');
5459
if ($argParent instanceof FuncCall && $argParent->name instanceof Name) {

0 commit comments

Comments
 (0)