Completed
Push — master ( eeb01f...41cc3f )
by Tristan
02:06
created

FailureReport::getDetails()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Enzyme\Axiom\Reports;
4
5
use Enzyme\Axiom\Atoms\StringAtom;
6
7
class FailureReport implements ReportInterface
8
{
9
    /**
10
     * The human readable message describing this report.
11
     * @var StringAtom
12
     */
13
    protected $message;
14
15
    /**
16
     * The optional details associated with this report.
17
     * @var array
18
     */
19
    protected $details;
20
21
    /**
22
     * Create a new generic failure report given the message and optional
23
     * details associated with it.
24
     *
25
     * @param StringAtom $message
26
     * @param array $details
27
     */
28
    public function __construct(StringAtom $message, array $details = [])
29
    {
30
        $this->message = $message;
31
        $this->details = $details;
32
    }
33
34
    /**
35
     * @see ReportInterface
36
     */
37
    public function getMessage()
38
    {
39
        return $this->message->getValue();
40
    }
41
42
    /**
43
     * @see ReportInterface
44
     */
45
    public function hasDetails()
46
    {
47
        return count($this->details) > 0;
48
    }
49
50
    /**
51
     * @see ReportInterface
52
     */
53
    public function getDetails()
54
    {
55
        return $this->details;
56
    }
57
}
58