Test Failed
Push — master ( 811c27...aa94e6 )
by Alexander
06:04
created

XmlWithProtectedField::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: horat1us
5
 * Date: 8/6/17
6
 * Time: 5:11 PM
7
 */
8
9
namespace Horat1us\Tests\helpers;
10
11
12
use Horat1us\XmlConvertible;
13
use Horat1us\XmlConvertibleInterface;
14
15
/**
16
 * Class XmlWithProtectedField
17
 * @package Horat1us\Tests\helpers
18
 */
19
class XmlWithProtectedField implements XmlConvertibleInterface
20
{
21
    use XmlConvertible;
22
23
    /**
24
     * @var string
25
     */
26
    protected $protectedField;
27
28
    /**
29
     * XmlWithProtectedField constructor.
30
     * @param string $protectedFieldValue
31
     */
32
    public function __construct(string $protectedFieldValue)
33
    {
34
        $this->setProtectedField($protectedFieldValue);
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getProtectedField(): string
41
    {
42
        return $this->protectedField;
43
    }
44
45
    /**
46
     * @param string $newValue
47
     * @return $this
48
     */
49
    public function setProtectedField(string $newValue)
50
    {
51
        $this->protectedField = $newValue;
52
        return $this;
53
    }
54
55
    /**
56
     * @param array|null $properties
57
     * @return array
58
     */
59
    public function getXmlProperties(array $properties = null): array
60
    {
61
        return ['protectedField'];
62
    }
63
}