Completed
Push — develop ( 141adb...8f70d4 )
by Jaap
05:39
created

GarbageCollectCache   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of phpDocumentor.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @author    Mike van Riel <[email protected]>
12
 * @copyright 2010-2018 Mike van Riel / Naenius (http://www.naenius.com)
13
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
14
 * @link      http://phpdoc.org
15
 */
16
17
namespace phpDocumentor\Application\Stage\Cache;
18
19
use phpDocumentor\Descriptor\Cache\ProjectDescriptorMapper;
20
use phpDocumentor\Application\Stage\Parser\Payload;
21
22
final class GarbageCollectCache
23
{
24
    /**
25
     * @var ProjectDescriptorMapper
26
     */
27
    private $descriptorMapper;
28
29
    public function __construct(ProjectDescriptorMapper $descriptorMapper)
30
    {
31
        $this->descriptorMapper = $descriptorMapper;
32
    }
33
34
    public function __invoke(Payload $payload)
35
    {
36
        $this->descriptorMapper->garbageCollect($payload->getFiles());
37
        return $payload;
38
    }
39
}
40