Completed
Push — master ( 6c409f...23b86d )
by James
11s
created

InvalidArgumentException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromKeyAndInvalidTTL() 0 8 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Roave\DoctrineSimpleCache\Exception;
5
6
class InvalidArgumentException
7
    extends \InvalidArgumentException
8
    implements \Psr\SimpleCache\InvalidArgumentException
9
{
10 2
    public static function fromKeyAndInvalidTTL(string $key, $ttl) : self
11
    {
12 2
        return new self(sprintf(
13 2
            'TTL for "%s" should be defined by an integer or a DateInterval, but %s is given.',
14
            $key,
15 2
            is_object($ttl) ? get_class($ttl) : gettype($ttl)
16
        ));
17
    }
18
}
19