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

InvalidArgumentException::fromKeyAndInvalidTTL()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
crap 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
    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