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

Breadcrumb

  1. Drupal Core 11.1.x

InvalidTypeNode.php

Namespace

PHPStan\PhpDocParser\Ast\Type

File

vendor/phpstan/phpdoc-parser/src/Ast/Type/InvalidTypeNode.php

View source
<?php

declare (strict_types=1);
namespace PHPStan\PhpDocParser\Ast\Type;

use PHPStan\PhpDocParser\Ast\NodeAttributes;
use PHPStan\PhpDocParser\Parser\ParserException;
class InvalidTypeNode implements TypeNode {
    use NodeAttributes;
    
    /** @var mixed[] */
    private $exceptionArgs;
    public function __construct(ParserException $exception) {
        $this->exceptionArgs = [
            $exception->getCurrentTokenValue(),
            $exception->getCurrentTokenType(),
            $exception->getCurrentOffset(),
            $exception->getExpectedTokenType(),
            $exception->getExpectedTokenValue(),
            $exception->getCurrentTokenLine(),
        ];
    }
    public function getException() : ParserException {
        return new ParserException(...$this->exceptionArgs);
    }
    public function __toString() : string {
        return '*Invalid type*';
    }

}

Classes

Title Deprecated Summary
InvalidTypeNode
RSS feed
Powered by Drupal