Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. JsonDecoder.php

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

JsonDecoder

Namespace

PhpParser

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal