Type   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 21
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getType() 0 3 1
A isEqual() 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 type of static analysis violation.
17
 */
18
final class Type
19
{
20
    /**
21
     * Type constructor.
22
     */
23
    public function __construct(
24
        private string $type,
25
    ) {
26
    }
27
28
    public function getType(): string
29
    {
30
        return $this->type;
31
    }
32
33
    /**
34
     * Return true if equal.
35
     */
36
    public function isEqual(self $type): bool
37
    {
38
        return $this->type === $type->getType();
39
    }
40
}
41