mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 11:44:14 +01:00
move to SilentKeyNodeInterface fully
This commit is contained in:
parent
b161d55ae2
commit
3c1761bcc3
@ -187,15 +187,17 @@ abstract class AbstractTagValueNode implements AttributeAwareNodeInterface, PhpD
|
||||
);
|
||||
}
|
||||
|
||||
protected function resolveOriginalContentSpacingAndOrder(?string $originalContent, ?string $silentKey = null): void
|
||||
protected function resolveOriginalContentSpacingAndOrder(?string $originalContent): void
|
||||
{
|
||||
$this->keysByQuotedStatus = [];
|
||||
if ($originalContent === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($silentKey === null && $this instanceof SilentKeyNodeInterface) {
|
||||
if ($this instanceof SilentKeyNodeInterface) {
|
||||
$silentKey = $this->getSilentKey();
|
||||
} else {
|
||||
$silentKey = null;
|
||||
}
|
||||
|
||||
$this->originalContent = $originalContent;
|
||||
|
@ -89,7 +89,7 @@ final class TableTagValueNode extends AbstractDoctrineTagValueNode implements Si
|
||||
$this->uniqueConstraints = $uniqueConstraints;
|
||||
$this->options = $options;
|
||||
|
||||
$this->resolveOriginalContentSpacingAndOrder($originalContent, 'name');
|
||||
$this->resolveOriginalContentSpacingAndOrder($originalContent);
|
||||
|
||||
$this->haveIndexesFinalComma = $haveIndexesFinalComma;
|
||||
$this->haveUniqueConstraintsFinalComma = $haveUniqueConstraintsFinalComma;
|
||||
|
@ -6,9 +6,10 @@ namespace Rector\BetterPhpDocParser\PhpDocNode\JMS;
|
||||
|
||||
use JMS\DiExtraBundle\Annotation\Inject;
|
||||
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
|
||||
use Rector\BetterPhpDocParser\Contract\PhpDocNode\SilentKeyNodeInterface;
|
||||
use Rector\BetterPhpDocParser\PhpDocNode\AbstractTagValueNode;
|
||||
|
||||
final class JMSInjectTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface
|
||||
final class JMSInjectTagValueNode extends AbstractTagValueNode implements ShortNameAwareTagInterface, SilentKeyNodeInterface
|
||||
{
|
||||
/**
|
||||
* @var string|null
|
||||
@ -20,7 +21,7 @@ final class JMSInjectTagValueNode extends AbstractTagValueNode implements ShortN
|
||||
$this->items = get_object_vars($inject);
|
||||
$this->serviceName = $serviceName;
|
||||
|
||||
$this->resolveOriginalContentSpacingAndOrder($annotationContent, 'value');
|
||||
$this->resolveOriginalContentSpacingAndOrder($annotationContent);
|
||||
}
|
||||
|
||||
public function getServiceName(): ?string
|
||||
@ -32,4 +33,9 @@ final class JMSInjectTagValueNode extends AbstractTagValueNode implements ShortN
|
||||
{
|
||||
return '@DI\Inject';
|
||||
}
|
||||
|
||||
public function getSilentKey(): string
|
||||
{
|
||||
return 'value';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user