FileName   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 19
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFileName() 0 3 1
A isEqual() 0 7 2
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * Static Analysis Results Baseliner (sarb).
5
 *
6
 * (c) Dave Liddament
7
 *
8
 * For the full copyright and licence information please view the LICENSE file distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common;
14
15
/**
16
 * Represents the full path of a file relative to the root of the repository.
17
 */
18
class FileName
19
{
20
    protected function __construct(
21
        private string $fileName,
22
    ) {
23
    }
24
25
    public function getFileName(): string
26
    {
27
        return $this->fileName;
28
    }
29
30
    public function isEqual(?self $fileName): bool
31
    {
32
        if (null === $fileName) {
33
            return false;
34
        }
35
36
        return $this->fileName === $fileName->getFileName();
37
    }
38
}
39