AttributeContainerTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addAttribute() 0 3 1
A getAttributes() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GoetasWebservices\XML\XSDReader\Schema\Attribute;
6
7
trait AttributeContainerTrait
8
{
9
    /**
10
     * @var AttributeItem[]
11
     */
12
    protected $attributes = [];
13
14 74
    public function addAttribute(AttributeItem $attribute): void
15
    {
16 74
        $this->attributes[] = $attribute;
17 74
    }
18
19
    /**
20
     * @return AttributeItem[]
21
     */
22 7
    public function getAttributes(): array
23
    {
24 7
        return $this->attributes;
25
    }
26
}
27