CommonTrait::isRemoved()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 2
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 1
nc 1
nop 0
crap 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
}