Completed
Pull Request — master (#13)
by Hyunwoo
02:26
created

InvalidArgumentException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromKeyAndInvalidTTL() 0 8 1
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
    public static function fromKeyAndInvalidTTL($key, $ttl) : self
11
    {
12
        return new self(sprintf(
13
            'TTL for "%s" should be defined by an integer or a DateInterval object, but %s is given.',
14
            $key,
15
            gettype($ttl)
16
        ));
17
    }
18
}
19