Completed
Push — master ( ccb9d5...d7e68d )
by Alejandro
09:04
created

NonUniqueSlugException::fromSlug()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Shlinkio\Shlink\Core\Exception;
5
6
use Shlinkio\Shlink\Common\Exception\InvalidArgumentException;
7
8
class NonUniqueSlugException extends InvalidArgumentException
9
{
10 1
    public static function fromSlug(string $slug): self
11
    {
12 1
        return new self(sprintf('Provided slug "%s" is not unique.', $slug));
13
    }
14
}
15