| 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( | 
| 21: | 'An invalid empty list of paths was provided for PSR mapping prefix "%s"', | 
| 22: | $prefix, | 
| 23: | )); | 
| 24: | } | 
| 25: |  | 
| 26: | public static function prefixMappingIsNotADirectory(string $prefix, string $path): self | 
| 27: | { | 
| 28: | return new self(sprintf( | 
| 29: | 'Provided path "%s" for prefix "%s" is not a directory', | 
| 30: | $prefix, | 
| 31: | $path, | 
| 32: | )); | 
| 33: | } | 
| 34: | } | 
| 35: |  |