Completed
Push — master ( 9b96e2...70e41f )
by Luke
04:58
created

RemoveTempDirectoriesStep::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 3
nc 1
nop 2
crap 2
1
<?php
2
3
/**
4
 * Moodle component manager.
5
 *
6
 * @author Luke Carrier <[email protected]>
7
 * @copyright 2016 Luke Carrier
8
 * @license GPL-3.0+
9
 */
10
11
namespace ComponentManager\Step;
12
13
use ComponentManager\Platform\Platform;
14
use Psr\Log\LoggerInterface;
15
16
/**
17
 * Remove temporary directories.
18
 */
19
class RemoveTempDirectoriesStep implements Step {
20
    /**
21
     * Platform.
22
     *
23
     * @var \ComponentManager\Platform\Platform
24
     */
25
    protected $platform;
26
27
    /**
28
     * Initialiser.
29
     *
30
     * @param \ComponentManager\Platform\Platform $platform
31
     */
32
    public function __construct(Platform $platform) {
33
        $this->platform = $platform;
34
    }
35
36
    /**
37
     * @override \ComponentManager\Platform\Platform
38
     */
39
    public function execute($task, LoggerInterface $logger) {
40
        $logger->info('Removing temporary directories');
41
        $this->platform->removeTempDirectories();
42
    }
43
}
44