for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
/**
* @license http://opensource.org/licenses/mit-license.php MIT
* @link https://github.com/nicoSWD
* @author Nicolas Oelgart <[email protected]>
*/
namespace nicoSWD\Rule\TokenStream\Node;
use nicoSWD\Rule\TokenStream\Token\BaseToken;
final class NodeVariable extends BaseNode
{
public function getNode(): BaseToken
$token = $this->tokenStream->getVariable($this->getVariableName());
while ($this->hasMethodCall()) {
$token = $this->getMethod($token)->call(...$this->getArguments());
}
return $token;
private function getVariableName(): string
return $this->getCurrentNode()->getOriginalValue();