remove unused interface

This commit is contained in:
TomasVotruba 2020-04-30 10:57:00 +02:00
parent 290dffbb53
commit 10f63db15d
5 changed files with 9 additions and 27 deletions

View File

@ -1,10 +0,0 @@
<?php
declare(strict_types=1);
namespace Rector\BetterPhpDocParser\Contract;
interface ClassAwarePhpDocNodeFactoryInterface extends PhpDocNodeFactoryInterface
{
public function getClass(): string;
}

View File

@ -11,4 +11,6 @@ use PHPStan\PhpDocParser\Parser\TokenIterator;
interface PhpDocNodeFactoryInterface
{
public function createFromNodeAndTokens(Node $node, TokenIterator $tokenIterator): ?PhpDocTagValueNode;
public function getClass(): string;
}

View File

@ -8,11 +8,11 @@ use Nette\Utils\Strings;
use PhpParser\Node;
use PHPStan\PhpDocParser\Parser\TokenIterator;
use Rector\BetterPhpDocParser\AnnotationReader\NodeAnnotationReader;
use Rector\BetterPhpDocParser\Contract\ClassAwarePhpDocNodeFactoryInterface;
use Rector\BetterPhpDocParser\Contract\PhpDocNodeFactoryInterface;
use Rector\BetterPhpDocParser\PhpDocParser\AnnotationContentResolver;
use Rector\NodeTypeResolver\Node\AttributeKey;
abstract class AbstractPhpDocNodeFactory implements ClassAwarePhpDocNodeFactoryInterface
abstract class AbstractPhpDocNodeFactory implements PhpDocNodeFactoryInterface
{
/**
* @var NodeAnnotationReader

View File

@ -59,11 +59,6 @@ final class ParamPhpDocNodeFactory
$this->annotationContentResolver = $annotationContentResolver;
}
public function getName(): string
{
return 'param';
}
public function createFromTokens(TokenIterator $tokenIterator): ?PhpDocTagValueNode
{
try {

View File

@ -19,7 +19,6 @@ use PHPStan\PhpDocParser\Parser\TypeParser;
use Rector\AttributeAwarePhpDoc\Ast\PhpDoc\AttributeAwarePhpDocNode;
use Rector\BetterPhpDocParser\Attributes\Ast\AttributeAwareNodeFactory;
use Rector\BetterPhpDocParser\Attributes\Attribute\Attribute;
use Rector\BetterPhpDocParser\Contract\ClassAwarePhpDocNodeFactoryInterface;
use Rector\BetterPhpDocParser\Contract\PhpDocNodeFactoryInterface;
use Rector\BetterPhpDocParser\PhpDocNodeFactory\ParamPhpDocNodeFactory;
use Rector\BetterPhpDocParser\Printer\MultilineSpaceFormatPreserver;
@ -288,15 +287,11 @@ final class BetterPhpDocParser extends PhpDocParser
// normalize
$tag = ltrim($tag, '@');
if ($phpDocNodeFactory instanceof ClassAwarePhpDocNodeFactoryInterface) {
return $this->classAnnotationMatcher->isTagMatchToNodeAndClass(
$tag,
$phpNode,
$phpDocNodeFactory->getClass()
);
}
return false;
return $this->classAnnotationMatcher->isTagMatchToNodeAndClass(
$tag,
$phpNode,
$phpDocNodeFactory->getClass()
);
}
private function getTokenIteratorIndex(TokenIterator $tokenIterator): int