Completed
Push — master ( 6f9845...68f10d )
by Marco
12:19 queued 14s
created

InvalidPrefixMapping::emptyPrefixGiven()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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