function Comment::jsonSerialize
Same name in this branch
- 11.1.x vendor/mck89/peast/lib/Peast/Syntax/Node/Comment.php \Peast\Syntax\Node\Comment::jsonSerialize()
Return value
array{nodeType:string, text:mixed, line:mixed, filePos:mixed}
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Comment.php, line 194
Class
Namespace
PhpParserCode
public function jsonSerialize() : array {
// Technically not a node, but we make it look like one anyway
$type = $this instanceof Comment\Doc ? 'Comment_Doc' : 'Comment';
return [
'nodeType' => $type,
'text' => $this->text,
// TODO: Rename these to include "start".
'line' => $this->startLine,
'filePos' => $this->startFilePos,
'tokenPos' => $this->startTokenPos,
'endLine' => $this->endLine,
'endFilePos' => $this->endFilePos,
'endTokenPos' => $this->endTokenPos,
];
}