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

TSchemaType   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 92
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 2
dl 92
loc 92
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getNamespace() 4 4 1
A setNamespace() 5 5 1
A getNamespaceUri() 4 4 1
A setNamespaceUri() 5 5 1
A getAlias() 4 4 1
A setAlias() 5 5 1
A isOK() 7 7 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\edm;
4
5
use AlgoWeb\ODataMetadata\IsOK;
6
use AlgoWeb\ODataMetadata\MetadataV3\edm\Groups\GSchemaBodyElementsTrait;
7
8
/**
9
 * Class representing TSchemaType
10
 *
11
 *
12
 * XSD Type: TSchema
13
 */
14 View Code Duplication
class TSchemaType 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...
15
{
16
    use GSchemaBodyElementsTrait;
17
    /**
18
     * @property string $namespace
19
     */
20
    private $namespace = null;
21
22
    /**
23
     * @property string $namespaceUri
24
     */
25
    private $namespaceUri = null;
26
27
    /**
28
     * @property string $alias
29
     */
30
    private $alias = null;
31
32
    /**
33
     * Gets as namespace
34
     *
35
     * @return string
36
     */
37
    public function getNamespace()
38
    {
39
        return $this->namespace;
40
    }
41
42
    /**
43
     * Sets a new namespace
44
     *
45
     * @param string $namespace
46
     * @return self
47
     */
48
    public function setNamespace($namespace)
49
    {
50
        $this->namespace = $namespace;
51
        return $this;
52
    }
53
54
    /**
55
     * Gets as namespaceUri
56
     *
57
     * @return string
58
     */
59
    public function getNamespaceUri()
60
    {
61
        return $this->namespaceUri;
62
    }
63
64
    /**
65
     * Sets a new namespaceUri
66
     *
67
     * @param string $namespaceUri
68
     * @return self
69
     */
70
    public function setNamespaceUri($namespaceUri)
71
    {
72
        $this->namespaceUri = $namespaceUri;
73
        return $this;
74
    }
75
76
    /**
77
     * Gets as alias
78
     *
79
     * @return string
80
     */
81
    public function getAlias()
82
    {
83
        return $this->alias;
84
    }
85
86
    /**
87
     * Sets a new alias
88
     *
89
     * @param string $alias
90
     * @return self
91
     */
92
    public function setAlias($alias)
93
    {
94
        $this->alias = $alias;
95
        return $this;
96
    }
97
    
98
    public function isOK(&$msg = null)
99
    {
100
        if ($this->isGSchemaBodyElementsValid($msg)) {
101
            return false;
102
        }
103
        return true;
104
    }
105
}
106