| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace PHPStan\BetterReflection\SourceLocator\Type\Composer\Psr\Exception; |
| 6: | |
| 7: | use InvalidArgumentException; |
| 8: | |
| 9: | use function sprintf; |
| 10: | |
| 11: | class InvalidPrefixMapping extends InvalidArgumentException implements Exception |
| 12: | { |
| 13: | public static function emptyPrefixGiven(): self |
| 14: | { |
| 15: | return new self('An invalid empty string provided as a PSR mapping prefix'); |
| 16: | } |
| 17: | |
| 18: | public static function emptyPrefixMappingGiven(string $prefix): self |
| 19: | { |
| 20: | return new self(sprintf('An invalid empty list of paths was provided for PSR mapping prefix "%s"', $prefix)); |
| 21: | } |
| 22: | |
| 23: | public static function prefixMappingIsNotADirectory(string $prefix, string $path): self |
| 24: | { |
| 25: | return new self(sprintf('Provided path "%s" for prefix "%s" is not a directory', $prefix, $path)); |
| 26: | } |
| 27: | } |
| 28: | |