TagEnumeration   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A getRestrictionParentType() 0 6 2
A getRestrictionParent() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WsdlToPhp\WsdlHandler\Tag;
6
7
use WsdlToPhp\WsdlHandler\AbstractDocument;
8
9
class TagEnumeration extends Tag
10
{
11
    /**
12
     * @return mixed
13
     */
14 4
    public function getValue()
15
    {
16 4
        return $this->getValueAttributeValue(true);
17
    }
18
19 4
    public function getRestrictionParent(): ?TagRestriction
20
    {
21 4
        return $this->getStrictParent(AbstractDocument::TAG_RESTRICTION);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getStrictP...ument::TAG_RESTRICTION) returns the type WsdlToPhp\DomHandler\ElementHandler which includes types incompatible with the type-hinted return WsdlToPhp\WsdlHandler\Tag\TagRestriction|null.
Loading history...
22
    }
23
24 2
    public function getRestrictionParentType(): string
25
    {
26
        /** @var null|TagRestriction $restrictionParent */
27 2
        $restrictionParent = $this->getRestrictionParent();
28
29 2
        return $restrictionParent ? $restrictionParent->getAttributeBase() : '';
0 ignored issues
show
introduced by
$restrictionParent is of type WsdlToPhp\WsdlHandler\Tag\TagRestriction, thus it always evaluated to true.
Loading history...
30
    }
31
}
32