Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 12 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
13 | View Code Duplication | public function testFromKeyAndInvalidTTLObject() |
|
|
|||
14 | { |
||
15 | $invalidTTL = new \stdClass(); |
||
16 | $exception = InvalidArgumentException::fromKeyAndInvalidTTL('key', $invalidTTL); |
||
17 | self::assertInstanceOf(InvalidArgumentException::class, $exception); |
||
18 | self::assertInstanceOf(\Psr\SimpleCache\InvalidArgumentException::class, $exception); |
||
19 | |||
20 | self::assertStringMatchesFormat( |
||
21 | 'TTL for "%s" should be defined by an integer or a DateInterval, but stdClass is given.', |
||
22 | $exception->getMessage() |
||
23 | ); |
||
24 | } |
||
25 | |||
39 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.