1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace PHPStan\BetterReflection\Reflection\Exception;
6:
7: use InvalidArgumentException;
8:
9: use function gettype;
10: use function sprintf;
11:
12: class NotAnObject extends InvalidArgumentException
13: {
14: /**
15: * @param mixed $nonObject
16: */
17: public static function fromNonObject($nonObject): self
18: {
19: return new self(sprintf('Provided "%s" is not an object', gettype($nonObject)));
20: }
21: }
22: