|
7 | 7 | use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprArrayItemNode;
|
8 | 8 | use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprArrayNode;
|
9 | 9 | use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode;
|
| 10 | +use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode; |
10 | 11 | use PHPStan\PhpDocParser\Ast\ConstExpr\QuoteAwareConstExprStringNode;
|
11 | 12 | use PHPStan\PhpDocParser\Ast\Node;
|
12 | 13 | use PHPStan\PhpDocParser\Ast\NodeTraverser;
|
|
23 | 24 | use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode;
|
24 | 25 | use PHPStan\PhpDocParser\Ast\Type\CallableTypeNode;
|
25 | 26 | use PHPStan\PhpDocParser\Ast\Type\CallableTypeParameterNode;
|
| 27 | +use PHPStan\PhpDocParser\Ast\Type\ConstTypeNode; |
26 | 28 | use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
|
27 | 29 | use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
28 | 30 | use PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode;
|
@@ -1426,6 +1428,40 @@ public function enterNode(Node $node)
|
1426 | 1428 |
|
1427 | 1429 | },
|
1428 | 1430 | ];
|
| 1431 | + |
| 1432 | + yield [ |
| 1433 | + '/** @param \DateTimeImmutable::ATOM $date */', |
| 1434 | + '/** @param DateTimeImmutable::ATOM $date */', |
| 1435 | + new class extends AbstractNodeVisitor { |
| 1436 | + |
| 1437 | + public function enterNode(Node $node) |
| 1438 | + { |
| 1439 | + if ($node instanceof ParamTagValueNode) { |
| 1440 | + $node->type = new ConstTypeNode(new ConstFetchNode('DateTimeImmutable', 'ATOM')); |
| 1441 | + } |
| 1442 | + |
| 1443 | + return $node; |
| 1444 | + } |
| 1445 | + |
| 1446 | + }, |
| 1447 | + ]; |
| 1448 | + |
| 1449 | + yield [ |
| 1450 | + '/** @param \Lorem\Ipsum $ipsum */', |
| 1451 | + '/** @param Ipsum $ipsum */', |
| 1452 | + new class extends AbstractNodeVisitor { |
| 1453 | + |
| 1454 | + public function enterNode(Node $node) |
| 1455 | + { |
| 1456 | + if ($node instanceof ParamTagValueNode) { |
| 1457 | + $node->type = new IdentifierTypeNode('Ipsum'); |
| 1458 | + } |
| 1459 | + |
| 1460 | + return $node; |
| 1461 | + } |
| 1462 | + |
| 1463 | + }, |
| 1464 | + ]; |
1429 | 1465 | }
|
1430 | 1466 |
|
1431 | 1467 | /**
|
|
0 commit comments