timer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Deployer;
5
6
use IntegerNet\DeployerTimer\DecorateAllTasks;
7
use IntegerNet\DeployerTimer\ResultTaskFactory;
8
use IntegerNet\DeployerTimer\TimerTaskDecorator;
9
10
/**
11
 * @SuppressWarnings(PHPMD.StaticAccess)
12
 */
13 3
if (!function_exists(__NAMESPACE__ . '\timer')) {
14
    function timer(): ResultTaskFactory
15
    {
16 3
        $deployer = Deployer::get();
17 3
        $decorateAllTasks = new DecorateAllTasks($deployer);
18 3
        $timer = new TimerTaskDecorator();
19 3
        $decorateAllTasks->with($timer);
20 3
        return new ResultTaskFactory($deployer, $timer);
21
    }
22
}
23