HasCdbXmlTrait   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 2
cbo 0
dl 0
loc 55
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setCdbXml() 0 9 2
A setCdbXmlNamespaceUri() 0 9 2
A getCdbXml() 0 4 1
A getCdbXmlNamespaceUri() 0 4 1
1
<?php
2
/**
3
 * @file
4
 */
5
6
namespace CultuurNet\UDB3;
7
8
trait HasCdbXmlTrait
9
{
10
11
    /**
12
     * @var string
13
     */
14
    protected $cdbXml;
15
16
    /**
17
     * @var string
18
     */
19
    protected $cdbXmlNamespaceUri;
20
21
    /**
22
     * @param string $cdbXml
23
     */
24
    private function setCdbXml($cdbXml)
25
    {
26
        if (!is_string($cdbXml)) {
27
            throw new \InvalidArgumentException(
28
                'Expected argument 1 to be a scalar string, received ' . gettype($cdbXml)
29
            );
30
        }
31
        $this->cdbXml = $cdbXml;
32
    }
33
34
    /**
35
     * @param string $cdbXmlNamespaceUri
36
     */
37
    private function setCdbXmlNamespaceUri($cdbXmlNamespaceUri)
38
    {
39
        if (!is_string($cdbXmlNamespaceUri)) {
40
            throw new \InvalidArgumentException(
41
                'Expected argument 1 to be a scalar string, received ' . gettype($cdbXmlNamespaceUri)
42
            );
43
        }
44
        $this->cdbXmlNamespaceUri = $cdbXmlNamespaceUri;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getCdbXml()
51
    {
52
        return $this->cdbXml;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getCdbXmlNamespaceUri()
59
    {
60
        return $this->cdbXmlNamespaceUri;
61
    }
62
}
63