1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace PHPStan\BetterReflection\Reflection\Exception;
6:
7: use PhpParser\Node\Stmt;
8: use PhpParser\PrettyPrinter\Standard;
9: use RuntimeException;
10:
11: use function sprintf;
12: use function substr;
13:
14: class InvalidArrowFunctionBodyNode extends RuntimeException
15: {
16: public static function create(Stmt $node): self
17: {
18: return new self(sprintf('Invalid arrow function body node (first 50 characters: %s)', substr((new Standard())->prettyPrint([$node]), 0, 50)));
19: }
20: }
21: