Skip to content

Commit

Permalink
ParametersAcceptorSelector - advanced array_map/array_filter inferenc…
Browse files Browse the repository at this point in the history
…e only for bleeding edge
  • Loading branch information
ondrejmirtes authored and mglaman committed Oct 7, 2021
1 parent 861a3ff commit 398afe6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Reflection/ParametersAcceptorSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Name;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\BleedingEdgeToggle;
use PHPStan\Reflection\Native\NativeParameterReflection;
use PHPStan\Reflection\Php\DummyParameter;
use PHPStan\TrinaryLogic;
Expand Down Expand Up @@ -48,7 +49,11 @@ public static function selectFromArgs(
{
$types = [];
$unpack = false;
if (count($args) > 0 && count($parametersAcceptors) > 0) {
if (
BleedingEdgeToggle::isBleedingEdge()
&& count($args) > 0
&& count($parametersAcceptors) > 0
) {
$functionName = null;
$argParent = $args[0]->getAttribute('parent');
if ($argParent instanceof FuncCall && $argParent->name instanceof Name) {
Expand Down

0 comments on commit 398afe6

Please sign in to comment.