Passed
Branch master (8fa86f)
by Alexander
04:20
created

XmlConvertibleObject::getXmlProperties()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: horat1us
5
 * Date: 5/2/17
6
 * Time: 1:55 PM
7
 */
8
9
namespace Horat1us;
10
11
12
/**
13
 * Class XmlConvertibleObject
14
 * @package Horat1us
15
 */
16
class XmlConvertibleObject implements XmlConvertibleInterface
17
{
18
    use XmlConvertible {
19
        getXmlProperties as protected traitXmlProperties;
20
    }
21
22
    /**
23
     * XmlConvertibleObject constructor.
24
     * @param string $xmlElementName
25
     * @param array $xmlChildren
26
     */
27 5
    public function __construct(string $xmlElementName = null, array $xmlChildren = null)
28
    {
29 5
        $this->xmlElementName = $xmlElementName;
30 5
        $this->xmlChildren = $xmlChildren;
31 5
    }
32
33
    /**
34
     * @return array
35
     */
36 5
    public function getXmlProperties(): array
37
    {
38 5
        return $this->traitXmlProperties(array_keys(get_object_vars($this)));
39
    }
40
}