Completed
Pull Request — master (#22)
by James
03:22
created

CacheException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 11
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromNonMultiOperationCache() 0 8 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Roave\DoctrineSimpleCache\Exception;
5
6
use Psr\SimpleCache\CacheException as PsrCacheException;
7
use Doctrine\Common\Cache\Cache as DoctrineCache;
8
9
final class CacheException extends \RuntimeException implements PsrCacheException
10
{
11 1
    public static function fromNonMultiOperationCache(DoctrineCache $cache) : self
12
    {
13 1
        return new self(sprintf(
14
            'The given cache %s does not support multiple operations, '
15 1
            . 'but you tried to use a feature that requires a multi-operation cache.',
16 1
            get_class($cache)
17
        ));
18
    }
19
}
20