Passed
Push — master ( 6dedb2...9b1dd9 )
by Vitaly
06:42
created

NullCG   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 27
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCommonPrefix() 0 4 1
A compareLength() 0 5 1
1
<?php declare(strict_types=1);
2
/**
3
 * Created by Vitaly Iegorov <[email protected]>.
4
 * on 07.04.17 at 07:43
5
 */
6
namespace samsonframework\stringconditiontree\string;
7
8
/**
9
 * Null character group with lowest priority.
10
 *
11
 * @author Vitaly Egorov <[email protected]>
12
 */
13
class NullCG extends AbstractCG
14
{
15
    /**
16
     * NullCG constructor.
17
     */
18 17
    public function __construct()
19
    {
20 17
        parent::__construct('', 0);
21 17
    }
22
23
    /**
24
     * @inheritdoc
25
     */
26
    public function getCommonPrefix(AbstractCG $group): string
27
    {
28
        return '';
29
    }
30
31
    /**
32
     * @inheritdoc
33
     */
34
    protected function compareLength(AbstractCG $group): int
35
    {
36
        // Passed character group always has higher priority
37
        return -1;
38
    }
39
}
40