-
-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored to use new features of PHPStan PHPDoc parser
- Loading branch information
Showing
97 changed files
with
1,450 additions
and
4,987 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace SlevomatCodingStandard\Helpers; | ||
|
||
use PHPStan\PhpDocParser\Ast\PhpDoc\InvalidTagValueNode; | ||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode; | ||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode; | ||
|
||
/** | ||
* @internal | ||
* @template T of PhpDocTagValueNode | ||
*/ | ||
class Annotation | ||
{ | ||
|
||
/** @var PhpDocTagNode */ | ||
private $node; | ||
|
||
/** @var int */ | ||
private $startPointer; | ||
|
||
/** @var int */ | ||
private $endPointer; | ||
|
||
public function __construct(PhpDocTagNode $node, int $startPointer, int $endPointer) | ||
{ | ||
$this->node = $node; | ||
$this->startPointer = $startPointer; | ||
$this->endPointer = $endPointer; | ||
} | ||
|
||
public function getNode(): PhpDocTagNode | ||
{ | ||
return $this->node; | ||
} | ||
|
||
public function getName(): string | ||
{ | ||
return $this->node->name; | ||
} | ||
|
||
/** | ||
* @return T | ||
*/ | ||
public function getValue(): PhpDocTagValueNode | ||
{ | ||
/** @phpstan-ignore-next-line */ | ||
return $this->node->value; | ||
} | ||
|
||
public function getStartPointer(): int | ||
{ | ||
return $this->startPointer; | ||
} | ||
|
||
public function getEndPointer(): int | ||
{ | ||
return $this->endPointer; | ||
} | ||
|
||
public function isInvalid(): bool | ||
{ | ||
return $this->node->value instanceof InvalidTagValueNode; | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
80 changes: 0 additions & 80 deletions
80
SlevomatCodingStandard/Helpers/Annotation/AssertAnnotation.php
This file was deleted.
Oops, something went wrong.
68 changes: 0 additions & 68 deletions
68
SlevomatCodingStandard/Helpers/Annotation/ExtendsAnnotation.php
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
SlevomatCodingStandard/Helpers/Annotation/GenericAnnotation.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.