Passed
Push — master ( feaee9...2b3e4e )
by Alex
04:28
created

GEmptyElementExtensibilityTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDocumentation() 0 4 1
A setDocumentation() 0 5 1
A isExtensibilityElementOK() 0 13 3
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\edm\Groups;
4
5
use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait;
6
use AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType;
7
8
trait GEmptyElementExtensibilityTrait
9
{
10
    use IsOKToolboxTrait;
11
12
    /**
13
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType $documentation
14
     */
15
    private $documentation = null;
16
17
    /**
18
     * Gets as documentation
19
     *
20
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType
21
     */
22
    public function getDocumentation()
23
    {
24
        return $this->documentation;
25
    }
26
27
    /**
28
     * Sets a new documentation
29
     *
30
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType $documentation
31
     * @return self
32
     */
33
    public function setDocumentation(TDocumentationType $documentation)
34
    {
35
        $this->documentation = $documentation;
36
        return $this;
37
    }
38
39
    public function isExtensibilityElementOK(&$msg = null)
40
    {
41
        if (!$this->isObjectNullOrType(
42
            '\AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType',
43
            $this->documentation
44
        )) {
45
            return false;
46
        }
47
        if (!$this->isObjectNullOrOK($this->documentation, $msg)) {
48
            return false;
49
        }
50
        return true;
51
    }
52
}
53