1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Broker;
4:
5: use PHPStan\AnalysedCodeException;
6: use function sprintf;
7:
8: /**
9: * @api
10: *
11: * Unchecked exception thrown from `ReflectionProvider`
12: * in case the user does not check the existence of the function beforehand
13: * with `hasFunction()`.
14: */
15: final class FunctionNotFoundException extends AnalysedCodeException
16: {
17:
18: public function __construct(private string $functionName)
19: {
20: parent::__construct(sprintf('Function %s not found while trying to analyse it - discovering symbols is probably not configured properly.', $functionName));
21: }
22:
23: public function getFunctionName(): string
24: {
25: return $this->functionName;
26: }
27:
28: public function getTip(): string
29: {
30: return 'Learn more at https://phpstan.org/user-guide/discovering-symbols';
31: }
32:
33: }
34: