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

Breadcrumb

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

function ParserException::__construct

File

vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php, line 35

Class

ParserException

Namespace

PHPStan\PhpDocParser\Parser

Code

public function __construct(string $currentTokenValue, int $currentTokenType, int $currentOffset, int $expectedTokenType, ?string $expectedTokenValue = null, ?int $currentTokenLine = null) {
    $this->currentTokenValue = $currentTokenValue;
    $this->currentTokenType = $currentTokenType;
    $this->currentOffset = $currentOffset;
    $this->expectedTokenType = $expectedTokenType;
    $this->expectedTokenValue = $expectedTokenValue;
    $this->currentTokenLine = $currentTokenLine;
    parent::__construct(sprintf('Unexpected token %s, expected %s%s at offset %d%s', $this->formatValue($currentTokenValue), Lexer::TOKEN_LABELS[$expectedTokenType], $expectedTokenValue !== null ? sprintf(' (%s)', $this->formatValue($expectedTokenValue)) : '', $currentOffset, $currentTokenLine === null ? '' : sprintf(' on line %d', $currentTokenLine)));
}

API Navigation

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