InitializeEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 3
dl 0
loc 38
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCoverageBounds() 0 4 1
A __construct() 0 5 1
A getReportDirectory() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of cloak.
5
 *
6
 * (c) Noritaka Horio <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace cloak\event;
13
14
use cloak\AnalyzerConfiguration;
15
use cloak\value\CoverageBounds;
16
use cloak\value\Path;
17
18
use \DateTimeImmutable;
19
20
21
/**
22
 * Class InitializeEvent
23
 * @package cloak\event
24
 */
25
final class InitializeEvent implements Event
26
{
27
28
    use DateTimeMessage;
29
30
    /**
31
     * @var AnalyzerConfiguration
32
     */
33
    private $config;
34
35
36
    /**
37
     * @param AnalyzerConfiguration $config
38
     */
39
    public function __construct(AnalyzerConfiguration $config)
40
    {
41
        $this->sendAt = new DateTimeImmutable();
42
        $this->config = $config;
43
    }
44
45
    /**
46
     * @return CoverageBounds
47
     */
48
    public function getCoverageBounds()
49
    {
50
        return $this->config->getCoverageBounds();
51
    }
52
53
    /**
54
     * @return Path
55
     */
56
    public function getReportDirectory()
57
    {
58
        $reportDirectory = $this->config->getReportDirectory();
59
        return Path::fromString($reportDirectory);
60
    }
61
62
}
63