function JsonDecoder::decodeComment
1 call to JsonDecoder::decodeComment()
- JsonDecoder::decodeRecursive in vendor/
nikic/ php-parser/ lib/ PhpParser/ JsonDecoder.php
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ JsonDecoder.php, line 72
Class
Namespace
PhpParserCode
private function decodeComment(array $value) : Comment {
$className = $value['nodeType'] === 'Comment' ? Comment::class : Comment\Doc::class;
if (!isset($value['text'])) {
throw new \RuntimeException('Comment must have text');
}
return new $className($value['text'], $value['line'] ?? -1, $value['filePos'] ?? -1, $value['tokenPos'] ?? -1, $value['endLine'] ?? -1, $value['endFilePos'] ?? -1, $value['endTokenPos'] ?? -1);
}