Passed
Push — master ( 4f9e3a...139be2 )
by Alexander
23:24
created

XmlWithProtectedField::setProtectedField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: horat1us
6
 * Date: 8/6/17
7
 * Time: 5:11 PM
8
 */
9
10
namespace Horat1us\Tests\helpers;
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
}
64