mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-22 02:36:52 +01:00
node printing functions consolidation
This commit is contained in:
parent
e299302591
commit
41e952e043
@ -82,7 +82,12 @@ abstract class AbstractTagValueNode implements AttributeAwareNodeInterface, PhpD
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
$items = $this->completeItemsQuotes($this->items);
|
||||
return $this->printItems($this->items);
|
||||
}
|
||||
|
||||
protected function printItems(array $items): string
|
||||
{
|
||||
$items = $this->completeItemsQuotes($items);
|
||||
$items = $this->filterOutMissingItems($items);
|
||||
$items = $this->makeKeysExplicit($items);
|
||||
|
||||
|
@ -21,14 +21,12 @@ final class SymfonyRouteTagValueNode extends AbstractTagValueNode implements Sho
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
if (isset($this->items['path']) || isset($this->items['localizedPaths'])) {
|
||||
$this->items['path'] = $this->items['path'] ?? $this->items['localizedPaths'];
|
||||
$items = $this->items;
|
||||
if (isset($items['path']) || isset($items['localizedPaths'])) {
|
||||
$items['path'] = $items['path'] ?? $this->items['localizedPaths'];
|
||||
}
|
||||
|
||||
$items = $this->completeItemsQuotes($this->items);
|
||||
$items = $this->makeKeysExplicit($items);
|
||||
|
||||
return $this->printContentItems($items);
|
||||
return $this->printItems($items);
|
||||
}
|
||||
|
||||
public function changeMethods(array $methods): void
|
||||
|
@ -21,11 +21,6 @@ final class AssertRangeTagValueNode extends AbstractTagValueNode implements Type
|
||||
|
||||
public function toAttributeString(): string
|
||||
{
|
||||
$items = $this->filterOutMissingItems($this->items);
|
||||
$items = $this->completeItemsQuotes($items);
|
||||
|
||||
$content = $this->printPhpAttributeItemsAsArray($items);
|
||||
|
||||
return $this->printPhpAttributeContent($content);
|
||||
return $this->printItemsToAttributeAsArrayString($this->items);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user