@@ 10-17 (lines=8) @@ | ||
7 | extends \InvalidArgumentException |
|
8 | implements \Psr\SimpleCache\InvalidArgumentException |
|
9 | { |
|
10 | public static function fromKeyAndInvalidTTL(string $key, $ttl) : self |
|
11 | { |
|
12 | return new self(sprintf( |
|
13 | 'TTL for "%s" should be defined by an integer or a DateInterval, but %s is given.', |
|
14 | $key, |
|
15 | is_object($ttl) ? get_class($ttl) : gettype($ttl) |
|
16 | )); |
|
17 | } |
|
18 | ||
19 | public static function fromInvalidKeyCharacters(string $invalidKey) : self |
|
20 | { |
|
@@ 27-33 (lines=7) @@ | ||
24 | )); |
|
25 | } |
|
26 | ||
27 | public static function fromInvalidType($invalidKey) : self |
|
28 | { |
|
29 | return new self(sprintf( |
|
30 | 'Key was not a valid type. Expected string, received %s', |
|
31 | is_object($invalidKey) ? get_class($invalidKey) : gettype($invalidKey) |
|
32 | )); |
|
33 | } |
|
34 | ||
35 | public static function fromEmptyKey() : self |
|
36 | { |
|
@@ 40-46 (lines=7) @@ | ||
37 | return new self('Requested key was an empty string.'); |
|
38 | } |
|
39 | ||
40 | public static function fromNonIterableKeys($invalidKeys) : self |
|
41 | { |
|
42 | return new self(sprintf( |
|
43 | 'Keys passed were not iterable (i.e. \Traversable or array), received: %s', |
|
44 | is_object($invalidKeys) ? get_class($invalidKeys) : gettype($invalidKeys) |
|
45 | )); |
|
46 | } |
|
47 | ||
48 | public static function fromNonIterableValues($invalidValues) : self |
|
49 | { |
|
@@ 48-54 (lines=7) @@ | ||
45 | )); |
|
46 | } |
|
47 | ||
48 | public static function fromNonIterableValues($invalidValues) : self |
|
49 | { |
|
50 | return new self(sprintf( |
|
51 | 'Values passed were not iterable (i.e. \Traversable or array), received: %s', |
|
52 | is_object($invalidValues) ? get_class($invalidValues) : gettype($invalidValues) |
|
53 | )); |
|
54 | } |
|
55 | } |
|
56 |