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

Breadcrumb

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

function BuilderHelpers::normalizeDocComment

Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc.

Parameters

Comment\Doc|string $docComment The doc comment to normalize:

Return value

Comment\Doc The normalized doc comment

4 calls to BuilderHelpers::normalizeDocComment()
ClassConst::setDocComment in vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php
Sets doc comment for the constant.
Declaration::setDocComment in vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php
Sets doc comment for the declaration.
EnumCase::setDocComment in vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php
Sets doc comment for the constant.
Property::setDocComment in vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php
Sets doc comment for the property.

File

vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php, line 286

Class

BuilderHelpers
This class defines helpers used in the implementation of builders. Don't use it directly.

Namespace

PhpParser

Code

public static function normalizeDocComment($docComment) : Comment\Doc {
    if ($docComment instanceof Comment\Doc) {
        return $docComment;
    }
    if (is_string($docComment)) {
        return new Comment\Doc($docComment);
    }
    throw new \LogicException('Doc comment must be a string or an instance of PhpParser\\Comment\\Doc');
}

API Navigation

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