1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace PHPStan\BetterReflection\Reflection\Exception;
6:
7: use PhpParser\Node\Stmt;
8: use PHPStan\BetterReflection\BetterReflection;
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: $printer = (new BetterReflection)->printer();
19: return new self(sprintf('Invalid arrow function body node (first 50 characters: %s)', substr($printer->prettyPrint([$node]), 0, 50)));
20: }
21: }
22: