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

XmlWithProtectedField   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 45
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getProtectedField() 0 4 1
A setProtectedField() 0 5 1
A getXmlProperties() 0 4 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
}