Passed
Push — master ( 143625...0aa694 )
by Alex
03:46
created

TPropertyRefType::isOK()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\edm;
4
5
use AlgoWeb\ODataMetadata\IsOK;
6
use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait;
7
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TSimpleIdentifierTrait;
8
9
/**
10
 * Class representing TPropertyRefType
11
 *
12
 *
13
 * XSD Type: TPropertyRef
14
 */
15 View Code Duplication
class TPropertyRefType extends IsOK
0 ignored issues
show
Duplication introduced by
This class 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...
16
{
17
    use IsOKToolboxTrait, TSimpleIdentifierTrait;
18
    /**
19
     * @property string $name
20
     */
21
    private $name = null;
22
23
    /**
24
     * Gets as name
25
     *
26
     * @return string
27
     */
28
    public function getName()
29
    {
30
        return $this->name;
31
    }
32
33
    /**
34
     * Sets a new name
35
     *
36
     * @param string $name
37
     * @return self
38
     */
39
    public function setName($name)
40
    {
41
        $this->name = $name;
42
        return $this;
43
    }
44
45
    public function isOK(&$msg = null)
46
    {
47
        if (!$this->isTSimpleIdentifierValid($this->name)) {
48
            $msg = "Name must be a valid TSimpleIdentifierValid";
49
            return false;
50
        }
51
        return true;
52
    }
53
}
54