Skip to content

Commit

Permalink
[DowngradePhp80] Fix Type boolan and array on DowngradeNamedArgumentR…
Browse files Browse the repository at this point in the history
…ector (#279)

* [DowngradePhp80] Fix Type boolan and array

* fix
  • Loading branch information
samsonasik committed Jun 23, 2021
1 parent 2ff589e commit 5daf169
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Param;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\ParameterReflection;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
use Rector\Core\Exception\NotImplementedYetException;
use PHPStan\Type\VerbosityLevel;
use Rector\Core\PHPStan\Reflection\CallReflectionResolver;
use Rector\Core\Rector\AbstractRector;
use Rector\TypeDeclaration\NodeTypeAnalyzer\CallTypeAnalyzer;
Expand Down Expand Up @@ -174,7 +172,6 @@ private function replacePreviousArgs(
continue;
}

// @todo convert type to value
$defaultValue = $this->mapPHPStanTypeToExpr($parameterReflection->getDefaultValue());
if (! $defaultValue instanceof Expr) {
continue;
Expand Down Expand Up @@ -217,10 +214,6 @@ private function mapPHPStanTypeToExpr(?Type $type): ?Expr
return null;
}

if ($type instanceof NullType) {
return new ConstFetch(new Name('null'));
}

throw new NotImplementedYetException();
return new ConstFetch(new Name($type->describe(VerbosityLevel::value())));
}
}

0 comments on commit 5daf169

Please sign in to comment.