Completed
Pull Request — master (#13)
by Hyunwoo
08:12 queued 02:24
created

InvalidArgumentException::fromKeyAndInvalidTTL()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
crap 2
1
<?php
2
namespace Roave\DoctrineSimpleCache;
3
4
use Psr\SimpleCache\InvalidArgumentException as PsrInvalidArgumentException;
5
6
class InvalidArgumentException extends \InvalidArgumentException implements PsrInvalidArgumentException
7
{
8
    public static function fromKeyAndInvalidTTL($key, $ttl): self
9
    {
10
        return new self(sprintf(
11
            'TTL for "%s" should be defined by an integer or a DateInterval object, but %s is given.',
12
            $key, gettype($ttl)
13
        ));
14
    }
15
}
16