Passed
Push — master ( 2b14a7...fa4f50 )
by Petr
02:38
created

CommonTestClass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 2
1
<?php
2
3
use kalanis\kw_files\Node;
4
use PHPUnit\Framework\TestCase;
5
6
7
/**
8
 * Class CommonTestClass
9
 * The structure for mocking and configuration seems so complicated, but it's necessary to let it be totally idiot-proof
10
 */
11
class CommonTestClass extends TestCase
12
{
13
    public function sortingPaths(Node $a, Node $b): int
14
    {
15
        return $this->fullPath($a) <=> $this->fullPath($b);
16
    }
17
18
    protected function fullPath(Node $node): string
19
    {
20
        return implode(DIRECTORY_SEPARATOR, $node->getPath());
21
    }
22
}
23