2020-08-11 10:59:04 +00:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2022-11-27 17:56:33 +00:00
|
|
|
namespace Rector\TypeDeclaration\Rector\ClassMethod;
|
2020-08-11 10:59:04 +00:00
|
|
|
|
2024-03-01 20:02:28 +00:00
|
|
|
use RectorPrefix202403\Nette\Utils\Strings;
|
2022-11-27 17:56:33 +00:00
|
|
|
use PhpParser\Node;
|
2023-09-30 09:01:28 +00:00
|
|
|
use PhpParser\Node\Attribute;
|
|
|
|
use PhpParser\Node\AttributeGroup;
|
2022-06-06 17:12:56 +00:00
|
|
|
use PhpParser\Node\Expr\Array_;
|
|
|
|
use PhpParser\Node\Expr\ArrayItem;
|
|
|
|
use PhpParser\Node\Expr\Yield_;
|
2023-09-30 09:01:28 +00:00
|
|
|
use PhpParser\Node\Scalar\String_;
|
2022-06-06 17:12:56 +00:00
|
|
|
use PhpParser\Node\Stmt\Class_;
|
|
|
|
use PhpParser\Node\Stmt\ClassMethod;
|
|
|
|
use PhpParser\Node\Stmt\Return_;
|
|
|
|
use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
|
|
|
|
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
|
|
|
|
use PHPStan\Type\Constant\ConstantArrayType;
|
|
|
|
use PHPStan\Type\MixedType;
|
|
|
|
use PHPStan\Type\Type;
|
2023-09-29 07:28:16 +00:00
|
|
|
use PHPStan\Type\TypeCombinator;
|
2022-06-06 17:12:56 +00:00
|
|
|
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
2023-09-20 12:41:26 +00:00
|
|
|
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
|
2024-01-02 02:40:38 +00:00
|
|
|
use Rector\Exception\ShouldNotHappenException;
|
2022-06-06 17:12:56 +00:00
|
|
|
use Rector\NodeTypeResolver\PHPStan\Type\TypeFactory;
|
2024-01-02 02:40:38 +00:00
|
|
|
use Rector\PhpParser\Node\BetterNodeFinder;
|
2022-11-27 17:56:33 +00:00
|
|
|
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
|
|
|
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
|
2024-01-02 02:40:38 +00:00
|
|
|
use Rector\Rector\AbstractRector;
|
2023-09-29 12:48:57 +00:00
|
|
|
use Rector\StaticTypeMapper\StaticTypeMapper;
|
2023-09-30 09:01:28 +00:00
|
|
|
use Rector\TypeDeclaration\ValueObject\DataProviderNodes;
|
2022-11-27 17:56:33 +00:00
|
|
|
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
|
|
|
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
|
|
|
/**
|
|
|
|
* @see \Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddParamTypeBasedOnPHPUnitDataProviderRector\AddParamTypeBasedOnPHPUnitDataProviderRectorTest
|
|
|
|
*/
|
|
|
|
final class AddParamTypeBasedOnPHPUnitDataProviderRector extends AbstractRector
|
2020-08-11 10:59:04 +00:00
|
|
|
{
|
2021-05-10 23:39:21 +00:00
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2021-05-10 23:39:21 +00:00
|
|
|
* @var \Rector\NodeTypeResolver\PHPStan\Type\TypeFactory
|
2020-08-11 10:59:04 +00:00
|
|
|
*/
|
|
|
|
private $typeFactory;
|
2021-01-18 21:45:13 +00:00
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2022-11-27 17:56:33 +00:00
|
|
|
* @var \Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer
|
2021-01-18 21:45:13 +00:00
|
|
|
*/
|
2022-11-27 17:56:33 +00:00
|
|
|
private $testsNodeAnalyzer;
|
2023-09-20 12:41:26 +00:00
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
|
|
|
|
*/
|
|
|
|
private $phpDocInfoFactory;
|
2023-09-20 12:55:35 +00:00
|
|
|
/**
|
|
|
|
* @readonly
|
2024-01-02 02:40:38 +00:00
|
|
|
* @var \Rector\PhpParser\Node\BetterNodeFinder
|
2023-09-20 12:55:35 +00:00
|
|
|
*/
|
|
|
|
private $betterNodeFinder;
|
2023-09-29 12:48:57 +00:00
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @var \Rector\StaticTypeMapper\StaticTypeMapper
|
|
|
|
*/
|
|
|
|
private $staticTypeMapper;
|
2023-06-08 22:00:17 +00:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private const ERROR_MESSAGE = 'Adds param type declaration based on PHPUnit provider return type declaration';
|
|
|
|
/**
|
|
|
|
* @see https://regex101.com/r/hW09Vt/1
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private const METHOD_NAME_REGEX = '#^(?<method_name>\\w+)(\\(\\))?#';
|
2023-09-29 12:48:57 +00:00
|
|
|
public function __construct(TypeFactory $typeFactory, TestsNodeAnalyzer $testsNodeAnalyzer, PhpDocInfoFactory $phpDocInfoFactory, BetterNodeFinder $betterNodeFinder, StaticTypeMapper $staticTypeMapper)
|
2021-05-09 20:15:43 +00:00
|
|
|
{
|
2020-08-11 10:59:04 +00:00
|
|
|
$this->typeFactory = $typeFactory;
|
2022-11-27 17:56:33 +00:00
|
|
|
$this->testsNodeAnalyzer = $testsNodeAnalyzer;
|
2023-09-20 12:41:26 +00:00
|
|
|
$this->phpDocInfoFactory = $phpDocInfoFactory;
|
2023-09-20 12:55:35 +00:00
|
|
|
$this->betterNodeFinder = $betterNodeFinder;
|
2023-09-29 12:48:57 +00:00
|
|
|
$this->staticTypeMapper = $staticTypeMapper;
|
2022-11-27 17:56:33 +00:00
|
|
|
}
|
|
|
|
public function getRuleDefinition() : RuleDefinition
|
|
|
|
{
|
|
|
|
return new RuleDefinition(self::ERROR_MESSAGE, [new CodeSample(<<<'CODE_SAMPLE'
|
2023-09-30 09:01:28 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2022-11-27 17:56:33 +00:00
|
|
|
|
|
|
|
final class SomeTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @dataProvider provideData()
|
|
|
|
*/
|
|
|
|
public function test($value)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-02-03 17:47:50 +00:00
|
|
|
public static function provideData()
|
2022-11-27 17:56:33 +00:00
|
|
|
{
|
|
|
|
yield ['name'];
|
2020-08-11 10:59:04 +00:00
|
|
|
}
|
2022-11-27 17:56:33 +00:00
|
|
|
}
|
|
|
|
CODE_SAMPLE
|
|
|
|
, <<<'CODE_SAMPLE'
|
2023-09-30 09:01:28 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2022-11-27 17:56:33 +00:00
|
|
|
|
|
|
|
final class SomeTest extends TestCase
|
|
|
|
{
|
2020-08-11 10:59:04 +00:00
|
|
|
/**
|
2022-11-27 17:56:33 +00:00
|
|
|
* @dataProvider provideData()
|
2020-08-11 10:59:04 +00:00
|
|
|
*/
|
2022-11-27 17:56:33 +00:00
|
|
|
public function test(string $value)
|
2020-08-11 10:59:04 +00:00
|
|
|
{
|
|
|
|
}
|
2022-11-27 17:56:33 +00:00
|
|
|
|
2023-02-03 17:47:50 +00:00
|
|
|
public static function provideData()
|
2022-11-27 17:56:33 +00:00
|
|
|
{
|
|
|
|
yield ['name'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CODE_SAMPLE
|
|
|
|
)]);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @return array<class-string<Node>>
|
|
|
|
*/
|
|
|
|
public function getNodeTypes() : array
|
2020-08-11 10:59:04 +00:00
|
|
|
{
|
2023-06-10 07:01:52 +00:00
|
|
|
return [Class_::class];
|
2022-11-27 17:56:33 +00:00
|
|
|
}
|
|
|
|
/**
|
2023-06-10 07:01:52 +00:00
|
|
|
* @param Class_ $node
|
2022-11-27 17:56:33 +00:00
|
|
|
*/
|
2023-08-05 10:29:33 +00:00
|
|
|
public function refactor(Node $node) : ?Node
|
2022-11-27 17:56:33 +00:00
|
|
|
{
|
|
|
|
if (!$this->testsNodeAnalyzer->isInTestClass($node)) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
$hasChanged = \false;
|
2023-06-10 07:01:52 +00:00
|
|
|
foreach ($node->getMethods() as $classMethod) {
|
|
|
|
if (!$classMethod->isPublic()) {
|
2022-11-27 21:23:52 +00:00
|
|
|
continue;
|
|
|
|
}
|
2023-06-10 07:01:52 +00:00
|
|
|
if ($classMethod->getParams() === []) {
|
2022-11-27 17:56:33 +00:00
|
|
|
continue;
|
|
|
|
}
|
2023-09-30 09:01:28 +00:00
|
|
|
$dataProviderNodes = $this->resolveDataProviderNodes($classMethod);
|
|
|
|
if ($dataProviderNodes->isEmpty()) {
|
2023-06-10 07:01:52 +00:00
|
|
|
return null;
|
|
|
|
}
|
2023-09-30 09:01:28 +00:00
|
|
|
$hasClassMethodChanged = $this->refactorClassMethod($classMethod, $node, $dataProviderNodes->nodes);
|
2023-07-19 11:50:09 +00:00
|
|
|
if ($hasClassMethodChanged) {
|
2023-06-10 07:01:52 +00:00
|
|
|
$hasChanged = \true;
|
|
|
|
}
|
2022-11-27 17:56:33 +00:00
|
|
|
}
|
|
|
|
if ($hasChanged) {
|
|
|
|
return $node;
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
2023-09-30 09:01:28 +00:00
|
|
|
/**
|
|
|
|
* @param \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode|\PhpParser\Node\Attribute $dataProviderNode
|
|
|
|
*/
|
2024-01-22 14:26:31 +00:00
|
|
|
private function inferParam(Class_ $class, int $parameterPosition, $dataProviderNode) : Type
|
2022-11-27 17:56:33 +00:00
|
|
|
{
|
2023-09-30 09:01:28 +00:00
|
|
|
$dataProviderClassMethod = $this->resolveDataProviderClassMethod($class, $dataProviderNode);
|
2022-06-07 08:22:29 +00:00
|
|
|
if (!$dataProviderClassMethod instanceof ClassMethod) {
|
|
|
|
return new MixedType();
|
2020-08-11 10:59:04 +00:00
|
|
|
}
|
|
|
|
/** @var Return_[] $returns */
|
2024-03-31 20:47:44 +00:00
|
|
|
$returns = $this->betterNodeFinder->findInstancesOfInFunctionLikeScoped($dataProviderClassMethod, Return_::class);
|
2021-02-24 15:21:11 +00:00
|
|
|
if ($returns !== []) {
|
2021-02-23 15:30:42 +00:00
|
|
|
return $this->resolveReturnStaticArrayTypeByParameterPosition($returns, $parameterPosition);
|
|
|
|
}
|
|
|
|
/** @var Yield_[] $yields */
|
2024-03-31 20:47:44 +00:00
|
|
|
$yields = $this->betterNodeFinder->findInstancesOfInFunctionLikeScoped($dataProviderClassMethod, Yield_::class);
|
2021-02-23 15:30:42 +00:00
|
|
|
return $this->resolveYieldStaticArrayTypeByParameterPosition($yields, $parameterPosition);
|
2020-08-11 10:59:04 +00:00
|
|
|
}
|
2023-09-30 09:01:28 +00:00
|
|
|
/**
|
|
|
|
* @param \PhpParser\Node\Attribute|\PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode $dataProviderNode
|
|
|
|
*/
|
|
|
|
private function resolveDataProviderClassMethod(Class_ $class, $dataProviderNode) : ?ClassMethod
|
2020-08-11 10:59:04 +00:00
|
|
|
{
|
2023-09-30 09:01:28 +00:00
|
|
|
if ($dataProviderNode instanceof Attribute) {
|
|
|
|
$value = $dataProviderNode->args[0]->value;
|
|
|
|
if (!$value instanceof String_) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
$content = $value->value;
|
|
|
|
} elseif ($dataProviderNode->value instanceof GenericTagValueNode) {
|
|
|
|
$content = $dataProviderNode->value->value;
|
|
|
|
} else {
|
2021-04-05 14:22:24 +00:00
|
|
|
return null;
|
|
|
|
}
|
2022-06-07 08:22:29 +00:00
|
|
|
$match = Strings::match($content, self::METHOD_NAME_REGEX);
|
2021-04-05 14:22:24 +00:00
|
|
|
if ($match === null) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
$methodName = $match['method_name'];
|
2021-11-06 12:10:48 +00:00
|
|
|
return $class->getMethod($methodName);
|
2020-08-11 10:59:04 +00:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @param Return_[] $returns
|
|
|
|
*/
|
2022-06-07 08:22:29 +00:00
|
|
|
private function resolveReturnStaticArrayTypeByParameterPosition(array $returns, int $parameterPosition) : Type
|
2020-08-11 10:59:04 +00:00
|
|
|
{
|
2021-03-02 13:43:36 +00:00
|
|
|
$firstReturnedExpr = $returns[0]->expr;
|
2022-06-07 08:22:29 +00:00
|
|
|
if (!$firstReturnedExpr instanceof Array_) {
|
|
|
|
return new MixedType();
|
2021-03-01 00:46:19 +00:00
|
|
|
}
|
2021-03-02 13:43:36 +00:00
|
|
|
$paramOnPositionTypes = $this->resolveParamOnPositionTypes($firstReturnedExpr, $parameterPosition);
|
2020-10-29 08:59:39 +00:00
|
|
|
if ($paramOnPositionTypes === []) {
|
2022-06-07 08:22:29 +00:00
|
|
|
return new MixedType();
|
2020-08-11 10:59:04 +00:00
|
|
|
}
|
2021-02-20 14:38:40 +00:00
|
|
|
return $this->typeFactory->createMixedPassedOrUnionType($paramOnPositionTypes);
|
2021-02-20 11:21:56 +00:00
|
|
|
}
|
2021-02-23 15:30:42 +00:00
|
|
|
/**
|
|
|
|
* @param Yield_[] $yields
|
|
|
|
*/
|
2022-06-07 08:22:29 +00:00
|
|
|
private function resolveYieldStaticArrayTypeByParameterPosition(array $yields, int $parameterPosition) : Type
|
2021-02-23 15:30:42 +00:00
|
|
|
{
|
|
|
|
$paramOnPositionTypes = [];
|
2021-03-05 10:55:40 +00:00
|
|
|
foreach ($yields as $yield) {
|
2022-06-07 08:22:29 +00:00
|
|
|
if (!$yield->value instanceof Array_) {
|
2021-02-23 15:30:42 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-03-05 10:55:40 +00:00
|
|
|
$type = $this->getTypeFromClassMethodYield($yield->value);
|
2022-06-07 08:22:29 +00:00
|
|
|
if (!$type instanceof ConstantArrayType) {
|
2021-02-23 15:30:42 +00:00
|
|
|
return $type;
|
|
|
|
}
|
|
|
|
foreach ($type->getValueTypes() as $position => $valueType) {
|
|
|
|
if ($position !== $parameterPosition) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$paramOnPositionTypes[] = $valueType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($paramOnPositionTypes === []) {
|
2022-06-07 08:22:29 +00:00
|
|
|
return new MixedType();
|
2021-02-23 15:30:42 +00:00
|
|
|
}
|
2021-02-24 15:21:11 +00:00
|
|
|
return $this->typeFactory->createMixedPassedOrUnionType($paramOnPositionTypes);
|
2021-02-23 15:30:42 +00:00
|
|
|
}
|
2021-06-18 17:31:16 +00:00
|
|
|
/**
|
2022-04-26 08:13:18 +00:00
|
|
|
* @return \PHPStan\Type\MixedType|\PHPStan\Type\Constant\ConstantArrayType
|
2021-06-18 17:31:16 +00:00
|
|
|
*/
|
2023-09-09 22:49:40 +00:00
|
|
|
private function getTypeFromClassMethodYield(Array_ $classMethodYieldArray)
|
2021-02-23 15:30:42 +00:00
|
|
|
{
|
2023-09-09 22:49:40 +00:00
|
|
|
$arrayType = $this->nodeTypeResolver->getType($classMethodYieldArray);
|
2021-02-23 15:30:42 +00:00
|
|
|
// impossible to resolve
|
2023-05-26 14:00:49 +00:00
|
|
|
if (!$arrayType instanceof ConstantArrayType) {
|
2022-06-07 08:22:29 +00:00
|
|
|
return new MixedType();
|
2021-02-23 15:30:42 +00:00
|
|
|
}
|
2023-05-26 14:00:49 +00:00
|
|
|
return $arrayType;
|
2021-02-23 15:30:42 +00:00
|
|
|
}
|
2021-03-02 13:43:36 +00:00
|
|
|
/**
|
|
|
|
* @return Type[]
|
|
|
|
*/
|
2022-06-07 08:22:29 +00:00
|
|
|
private function resolveParamOnPositionTypes(Array_ $array, int $parameterPosition) : array
|
2021-03-02 13:43:36 +00:00
|
|
|
{
|
|
|
|
$paramOnPositionTypes = [];
|
|
|
|
foreach ($array->items as $singleDataProvidedSet) {
|
2022-06-07 08:22:29 +00:00
|
|
|
if (!$singleDataProvidedSet instanceof ArrayItem || !$singleDataProvidedSet->value instanceof Array_) {
|
|
|
|
throw new ShouldNotHappenException();
|
2021-03-02 13:43:36 +00:00
|
|
|
}
|
|
|
|
foreach ($singleDataProvidedSet->value->items as $position => $singleDataProvidedSetItem) {
|
|
|
|
if ($position !== $parameterPosition) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-06-07 08:22:29 +00:00
|
|
|
if (!$singleDataProvidedSetItem instanceof ArrayItem) {
|
2021-03-02 13:43:36 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-10-07 19:40:12 +00:00
|
|
|
$paramOnPositionTypes[] = $this->nodeTypeResolver->getType($singleDataProvidedSetItem->value);
|
2021-03-02 13:43:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return $paramOnPositionTypes;
|
|
|
|
}
|
2023-09-30 09:01:28 +00:00
|
|
|
private function resolveDataProviderNodes(ClassMethod $classMethod) : DataProviderNodes
|
|
|
|
{
|
|
|
|
$attributes = $this->getPhpDataProviderAttributes($classMethod);
|
|
|
|
$classMethodPhpDocInfo = $this->phpDocInfoFactory->createFromNode($classMethod);
|
|
|
|
$phpdocNodes = $classMethodPhpDocInfo instanceof PhpDocInfo ? $classMethodPhpDocInfo->getTagsByName('@dataProvider') : [];
|
|
|
|
return new DataProviderNodes(\array_merge($attributes, $phpdocNodes));
|
|
|
|
}
|
2023-09-29 07:28:16 +00:00
|
|
|
/**
|
2023-09-30 09:01:28 +00:00
|
|
|
* @return array<array-key, Attribute>
|
2023-09-29 07:28:16 +00:00
|
|
|
*/
|
2023-09-30 09:19:11 +00:00
|
|
|
private function getPhpDataProviderAttributes(ClassMethod $classMethod) : array
|
2022-11-27 17:56:33 +00:00
|
|
|
{
|
2023-09-30 09:01:28 +00:00
|
|
|
$attributeName = 'PHPUnit\\Framework\\Attributes\\DataProvider';
|
|
|
|
/** @var AttributeGroup[] $attrGroups */
|
2023-09-30 09:19:11 +00:00
|
|
|
$attrGroups = $classMethod->attrGroups;
|
2023-09-30 09:01:28 +00:00
|
|
|
$dataProviders = [];
|
|
|
|
foreach ($attrGroups as $attrGroup) {
|
|
|
|
foreach ($attrGroup->attrs as $attribute) {
|
|
|
|
if (!$this->nodeNameResolver->isName($attribute->name, $attributeName)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$dataProviders[] = $attribute;
|
|
|
|
}
|
2022-11-27 17:56:33 +00:00
|
|
|
}
|
2023-09-30 09:01:28 +00:00
|
|
|
return $dataProviders;
|
2022-11-27 17:56:33 +00:00
|
|
|
}
|
2023-09-29 07:28:16 +00:00
|
|
|
/**
|
2023-09-30 09:01:28 +00:00
|
|
|
* @param array<Attribute|PhpDocTagNode> $dataProviderNodes
|
2023-09-29 07:28:16 +00:00
|
|
|
*/
|
2023-09-30 09:01:28 +00:00
|
|
|
private function refactorClassMethod(ClassMethod $classMethod, Class_ $class, array $dataProviderNodes) : bool
|
2023-07-19 11:50:09 +00:00
|
|
|
{
|
|
|
|
$hasChanged = \false;
|
2024-01-22 14:26:31 +00:00
|
|
|
foreach ($classMethod->getParams() as $parameterPosition => $param) {
|
2023-07-19 11:50:09 +00:00
|
|
|
if ($param->type instanceof Node) {
|
|
|
|
continue;
|
|
|
|
}
|
2023-09-29 07:28:16 +00:00
|
|
|
$paramTypes = [];
|
2023-09-30 09:01:28 +00:00
|
|
|
foreach ($dataProviderNodes as $dataProviderNode) {
|
2024-01-22 14:26:31 +00:00
|
|
|
$paramTypes[] = $this->inferParam($class, $parameterPosition, $dataProviderNode);
|
2023-09-29 07:28:16 +00:00
|
|
|
}
|
|
|
|
$paramTypeDeclaration = TypeCombinator::union(...$paramTypes);
|
2023-07-19 11:50:09 +00:00
|
|
|
if ($paramTypeDeclaration instanceof MixedType) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$param->type = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($paramTypeDeclaration, TypeKind::PARAM);
|
|
|
|
$hasChanged = \true;
|
|
|
|
}
|
|
|
|
return $hasChanged;
|
|
|
|
}
|
2020-08-11 10:59:04 +00:00
|
|
|
}
|