Completed
Push — EZP-29891 ( 916cf6...0402ff )
by
unknown
16:53
created

AbstractHandler::getMultipleCacheItems()   B

Complexity

Conditions 9
Paths 41

Size

Total Lines 57

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 9
nc 41
nop 5
dl 0
loc 57
rs 7.3826
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/**
4
 * File containing the ContentHandler implementation.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\Persistence\Cache;
10
11
use eZ\Publish\SPI\Persistence\Handler as PersistenceHandler;
12
13
/**
14
 * Class AbstractHandler.
15
 *
16
 * Abstract handler for use in other Persistence Cache Handlers.
17
 */
18
abstract class AbstractHandler
19
{
20
    /**
21
     * @var \eZ\Publish\Core\Persistence\Cache\CacheServiceDecorator
22
     */
23
    protected $cache;
24
25
    /**
26
     * @var \eZ\Publish\SPI\Persistence\Handler
27
     */
28
    protected $persistenceHandler;
29
30
    /**
31
     * @var \eZ\Publish\Core\Persistence\Cache\PersistenceLogger
32
     */
33
    protected $logger;
34
35
    /**
36
     * Setups current handler with everything needed.
37
     *
38
     * @param \eZ\Publish\Core\Persistence\Cache\CacheServiceDecorator $cache
39
     * @param \eZ\Publish\SPI\Persistence\Handler $persistenceHandler
40
     * @param \eZ\Publish\Core\Persistence\Cache\PersistenceLogger $logger
41
     */
42
    public function __construct(
43
        CacheServiceDecorator $cache,
44
        PersistenceHandler $persistenceHandler,
45
        PersistenceLogger $logger
46
    ) {
47
        $this->cache = $cache;
48
        $this->persistenceHandler = $persistenceHandler;
49
        $this->logger = $logger;
50
    }
51
}
52