about summary refs log tree commit diff stats
path: root/vendor/phpdocumentor/reflection-docblock/src/Exception/ParserException.php
blob: 2a2ce805bb3b403c16c5f64b37d9a2046061c474 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

declare(strict_types=1);

namespace phpDocumentor\Reflection\Exception;

use InvalidArgumentException;

final class ParserException extends InvalidArgumentException implements ReflectionDocblockException
{
    public static function from(\PHPStan\PhpDocParser\Parser\ParserException $exception): self
    {
        return new self(
            'Failed to parse docblock: ' . $exception->getMessage(),
            0,
            $exception
        );
    }
}