Passed
Branch master (7a0b0e)
by Randy
02:56
created

Car   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setMarke() 0 4 1
A getMarke() 0 4 1
A assemble() 0 8 1
1
<?php
2
3
namespace Dgame\Soap\Test\Object;
4
5
use Dgame\Soap\Attribute\Attribute;
6
use Dgame\Soap\Element;
7
use Dgame\Soap\Hydrator\Dom\AssemblableInterface;
8
use Dgame\Soap\Hydrator\Hydratable;
9
10
/**
11
 * Class Car
12
 * @package Dgame\Soap\Test\Object
13
 */
14
final class Car extends Hydratable implements AssemblableInterface
15
{
16
    /**
17
     * @var string
18
     */
19
    private $marke;
20
    /**
21
     * @var string
22
     */
23
    public $kennung;
24
25
    /**
26
     * @param string $marke
27
     */
28
    public function setMarke(string $marke)
29
    {
30
        $this->marke = $marke;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getMarke(): string
37
    {
38
        return $this->marke;
39
    }
40
41
    /**
42
     * @return Element
43
     */
44
    public function assemble(): Element
45
    {
46
        $element = new Element('car');
47
        $element->setAttribute(new Attribute('marke', $this->marke));
48
        $element->setAttribute(new Attribute('kennung', $this->kennung));
49
50
        return $element;
51
    }
52
}