Subject::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Zortje\Rules;
4
5
/**
6
 * Class Subject
7
 *
8
 * @package Zortje\Rules
9
 */
10
class Subject
11
{
12
13
    /**
14
     * @var string
15
     */
16
    protected $contextDescription;
17
18
    /**
19
     * @var \DOMDocument
20
     */
21
    protected $dom;
22
23
    /**
24
     * RuleSubject constructor.
25
     *
26
     * @param string $contextDescription
27
     */
28 1
    public function __construct(string $contextDescription)
29
    {
30 1
        $this->contextDescription = $contextDescription;
31 1
    }
32
33
    /**
34
     * Get subject context description
35
     *
36
     * @return string Subject context description
37
     */
38 1
    public function getContextDescription(): string
39
    {
40 1
        return $this->contextDescription;
41
    }
42
43
    /**
44
     * Set DOM in subject
45
     *
46
     * @param \DOMDocument $dom
47
     */
48 1
    public function setDom(\DOMDocument $dom)
49
    {
50 1
        $this->dom = $dom;
51 1
    }
52
53
    /**
54
     * Get subject DOM
55
     *
56
     * @return \DOMDocument
57
     */
58 1
    public function getDom(): \DOMDocument
59
    {
60 1
        return $this->dom;
61
    }
62
}
63