1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace PHPStan\BetterReflection\SourceLocator\Exception;
6:
7: use RuntimeException;
8:
9: use function gettype;
10: use function is_object;
11: use function sprintf;
12:
13: class InvalidFileInfo extends RuntimeException
14: {
15: /**
16: * @param mixed $nonSplFileInfo
17: */
18: public static function fromNonSplFileInfo($nonSplFileInfo): self
19: {
20: return new self(sprintf('Expected an iterator of SplFileInfo instances, %s given instead', is_object($nonSplFileInfo) ? get_class($nonSplFileInfo) : gettype($nonSplFileInfo)));
21: }
22: }
23: