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

Breadcrumb

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

function ParserAbstract::createExitExpr

Parameters

array<Node\Arg|Node\VariadicPlaceholder> $args:

array<string, mixed> $attrs:

File

vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php, line 1216

Class

ParserAbstract

Namespace

PhpParser

Code

protected function createExitExpr(string $name, int $namePos, array $args, array $attrs) : Expr {
    if ($this->isSimpleExit($args)) {
        // Create Exit node for backwards compatibility.
        $attrs['kind'] = strtolower($name) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE;
        return new Expr\Exit_(\count($args) === 1 ? $args[0]->value : null, $attrs);
    }
    return new Expr\FuncCall(new Name($name, $this->getAttributesAt($namePos)), $args, $attrs);
}

API Navigation

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