InitializeEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 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