Completed
Push — master ( ed931d...d2bebe )
by Pavel
02:45
created

ConditionException::unsupportedArgumentToMatch()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 8
cts 8
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Bankiru\Seo\Exception;
4
5
use Bankiru\Seo\ConditionInterface;
6
7
class ConditionException extends \RuntimeException implements SeoExceptionInterface
8
{
9 1
    public static function unsupportedArgumentToMatch(ConditionInterface $condition, $argument)
10
    {
11 1
        return new static(
12 1
            sprintf(
13 1
                '%s cannot match argument of type %s',
14 1
                get_class($condition),
15 1
                is_object($argument) ? get_class($argument) : gettype($argument)
16 1
            )
17 1
        );
18
    }
19
}
20