Passed
Push — master ( 418524...2ac80a )
by Alex
03:43
created

TRuntimeConceptualModelsType   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSchema() 4 4 1
A setSchema() 5 5 1
A isOK() 8 8 3

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\edmx;
4
5
use AlgoWeb\ODataMetadata\IsOK;
6
use AlgoWeb\ODataMetadata\MetadataV3\edm\Schema;
7
8
/**
9
 * Class representing TRuntimeConceptualModelsType
10
 *
11
 *
12
 * XSD Type: TRuntimeConceptualModels
13
 */
14 View Code Duplication
class TRuntimeConceptualModelsType 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
17
    /**
18
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\Schema $schema
19
     */
20
    private $schema = null;
21
22
    /**
23
     * Gets as schema
24
     *
25
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\Schema
26
     */
27
    public function getSchema()
28
    {
29
        return $this->schema;
30
    }
31
32
    /**
33
     * Sets a new schema
34
     *
35
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\Schema $schema
36
     * @return self
37
     */
38
    public function setSchema(Schema $schema)
39
    {
40
        $this->schema = $schema;
41
        return $this;
42
    }
43
44
    public function isOK(&$msg = null)
45
    {
46
        if (null != $this->schema && !$this->schema->isOK($msg)) {
47
            return false;
48
        }
49
50
        return true;
51
    }
52
}
53