Completed
Push — master ( 8b8c0c...ed931d )
by Pavel
02:40
created

PageException::notFound()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Bankiru\Seo\Exception;
4
5
use Bankiru\Seo\TargetDefinitionInterface;
6
7
class PageException extends \RuntimeException implements SeoExceptionInterface
8
{
9 1
    public static function notFound(TargetDefinitionInterface $target)
10
    {
11 1
        return new static(
12 1
            sprintf(
13 1
                'No SEO page associated with target "%s"',
14 1
                method_exists($target, '__toString') ? (string)$target : $target->getRoute()
15 1
            )
16 1
        );
17
    }
18
}
19