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

PageException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 12
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A notFound() 0 9 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