CommonTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A isRemoved() 0 2 1
1
<?php declare(strict_types=1);
2
3
namespace DOMWrap\Traits;
4
5
use DOMWrap\NodeList;
6
7
/**
8
 * Common Trait
9
 *
10
 * @package DOMWrap\Traits
11
 * @license http://opensource.org/licenses/BSD-3-Clause BSD 3 Clause
12
 */
13
trait CommonTrait
14
{
15
    /**
16
     * @return NodeList
17
     */
18
    abstract public function collection(): NodeList;
19
20
    /**
21
     * @return \DOMDocument
22
     */
23
    abstract public function document(): ?\DOMDocument;
24
25
    /**
26
     * @param NodeList $nodeList
27
     *
28
     * @return NodeList|\DOMNode
29
     */
30
    abstract public function result(NodeList $nodeList);
31
32
    /**
33
     * @return bool
34
     */
35 130
    public function isRemoved(): bool {
36 130
        return !isset($this->nodeType);
37
    }
38
}