Completed
Pull Request — master (#69)
by Alex
04:33
created

isExtensibilityElementOK()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl\Groups;
4
5
use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait;
6
use AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl\TDocumentationType;
7
8
trait GEmptyElementExtensibilityTrait
9
{
10
    use IsOKToolboxTrait;
11
12
    /**
13
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl\TDocumentationType $documentation
14
     */
15
    private $documentation = null;
16
17
    /**
18
     * Gets as documentation
19
     *
20
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl\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\ssdl\TDocumentationType $documentation
31
     * @return self
32
     */
33 View Code Duplication
    public function setDocumentation(TDocumentationType $documentation)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
    {
35
        $msg = null;
36
        if (!$documentation->isOK($msg)) {
37
            throw new \InvalidArgumentException($msg);
38
        }
39
        $this->documentation = $documentation;
40
        return $this;
41
    }
42
43
    public function isExtensibilityElementOK(&$msg = null)
44
    {
45
        if (!$this->isObjectNullOrOK($this->documentation, $msg)) {
46
            return false;
47
        }
48
        return true;
49
    }
50
}
51