fix of/as

This commit is contained in:
TomasVotruba 2020-06-15 12:20:24 +02:00
parent 4132d9d885
commit 26b00c7b13
3 changed files with 14 additions and 3 deletions

View File

@ -19,9 +19,9 @@ final class AttributeAwareTemplateTagValueNode extends TemplateTagValueNode impl
*/
private $preposition;
public function __construct(string $name, ?TypeNode $bound, string $description, string $originalContent)
public function __construct(string $name, ?TypeNode $typeNode, string $description, string $originalContent)
{
parent::__construct($name, $bound, $description);
parent::__construct($name, $typeNode, $description);
$matches = Strings::match($originalContent, '#\s+(?<preposition>as|of)\s+#');
$this->preposition = $matches['preposition'] ?? 'of';

View File

@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Rector\BetterPhpDocParser\Tests\PhpDocParser\TagValueNodeReprint\Fixture\Native\Template;
/** @template T as int */
final class TemplateTagAsOf
final class TemplateTagAs
{
}

View File

@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Rector\BetterPhpDocParser\Tests\PhpDocParser\TagValueNodeReprint\Fixture\Native\Template;
/** @template T of int */
final class TemplateTagOf
{
}