environment = $parser->getEnvironment(); if (is_array($span)) { $span = implode("\n", $span); } if ($span instanceof SpanNode) { $span = $span->render(); } $spanProcessor = new SpanProcessor($this->environment, $span); $this->value = $spanProcessor->process(); $this->text = $spanProcessor->getText($this->value); $this->tokens = $spanProcessor->getTokens(); } public function getValue(): string { return $this->value; } /** @return SpanToken[] */ public function getTokens(): array { return $this->tokens; } public function getEnvironment(): Environment { return $this->environment; } public function getText(): string { return $this->text; } }