mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
7d36c3b0b9
a80cf5292d
revert to working scoper 0.14
53 lines
1.1 KiB
PHP
53 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\CodingStyle\ValueObject;
|
|
|
|
use PhpParser\Node;
|
|
use PhpParser\Node\Expr;
|
|
final class ConcatExpressionJoinData
|
|
{
|
|
/**
|
|
* @var string[]
|
|
*/
|
|
private $values = [];
|
|
/**
|
|
* @var Node[]
|
|
*/
|
|
private $nodesToRemove = [];
|
|
/**
|
|
* @var Expr[]
|
|
*/
|
|
private $placeholdersToNodes = [];
|
|
public function addString(string $value) : void
|
|
{
|
|
$this->values[] = $value;
|
|
}
|
|
public function addNodeToRemove(\PhpParser\Node $node) : void
|
|
{
|
|
$this->nodesToRemove[] = $node;
|
|
}
|
|
public function getString() : string
|
|
{
|
|
return \implode('', $this->values);
|
|
}
|
|
/**
|
|
* @return Node[]
|
|
*/
|
|
public function getNodesToRemove() : array
|
|
{
|
|
return $this->nodesToRemove;
|
|
}
|
|
public function addPlaceholderToNode(string $objectHash, \PhpParser\Node\Expr $expr) : void
|
|
{
|
|
$this->placeholdersToNodes[$objectHash] = $expr;
|
|
}
|
|
/**
|
|
* @return Expr[]
|
|
*/
|
|
public function getPlaceholdersToNodes() : array
|
|
{
|
|
return $this->placeholdersToNodes;
|
|
}
|
|
}
|