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 81.82%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
dl 50
loc 50
ccs 9
cts 11
cp 0.8182
rs 10
c 3
b 0
f 0
wmc 4

4 Methods

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