mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-11 05:32:23 +00:00
3313a231b7
bb609b28e3
[Core] Always reset stopTraversal to false on next Rector visit (#4182)
39 lines
905 B
PHP
39 lines
905 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\BetterPhpDocParser\PhpDoc;
|
|
|
|
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
|
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode;
|
|
use Stringable;
|
|
final class ArrayItemNode implements PhpDocTagValueNode
|
|
{
|
|
public $value;
|
|
public $key = null;
|
|
use NodeAttributes;
|
|
/**
|
|
* @param mixed $value
|
|
* @param mixed $key
|
|
*/
|
|
public function __construct($value, $key = null)
|
|
{
|
|
$this->value = $value;
|
|
$this->key = $key;
|
|
}
|
|
public function __toString() : string
|
|
{
|
|
$value = '';
|
|
if ($this->key !== null) {
|
|
$value .= $this->key . '=';
|
|
}
|
|
if (\is_array($this->value)) {
|
|
foreach ($this->value as $singleValue) {
|
|
$value .= $singleValue;
|
|
}
|
|
} else {
|
|
$value .= $this->value;
|
|
}
|
|
return $value;
|
|
}
|
|
}
|