Passed
Push — static-analysis ( 1958c5...5a8282 )
by SignpostMarv
10:41 queued 08:16
created

Group   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 100 %

Test Coverage

Coverage 63.64%

Importance

Changes 0
Metric Value
dl 50
loc 50
ccs 7
cts 11
cp 0.6364
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getSchema() 3 3 1
A __construct() 4 4 1
A getDoc() 3 3 1
A setDoc() 5 5 1

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 GoetasWebservices\XML\XSDReader\Schema\Attribute;
4
5
use GoetasWebservices\XML\XSDReader\Schema\Schema;
6
7 View Code Duplication
class Group implements AttributeItem, AttributeContainer
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...
8
{
9
    use AttributeItemTrait;
10
    use AttributeContainerTrait;
11
12
    /**
13
     * @var Schema
14
     */
15
    protected $schema;
16
17
    /**
18
     * @var string|null
19
     */
20
    protected $doc;
21
22
    /**
23
     * @param string $name
24
     */
25 45
    public function __construct(Schema $schema, $name)
26
    {
27 45
        $this->schema = $schema;
28 45
        $this->name = $name;
29 45
    }
30
31
    /**
32
     * @return string|null
33
     */
34
    public function getDoc()
35
    {
36
        return $this->doc;
37
    }
38
39
    /**
40
     * @param string $doc
41
     *
42
     * @return $this
43
     */
44 45
    public function setDoc($doc)
45
    {
46 45
        $this->doc = $doc;
47
48 45
        return $this;
49
    }
50
51
    /**
52
     * @return Schema
53
     */
54
    public function getSchema()
55
    {
56
        return $this->schema;
57
    }
58
}
59