FriendlySolution   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 4
c 2
b 0
f 0
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getSolutionDescription() 0 3 1
A getDocumentationLinks() 0 3 1
A getSolutionTitle() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiistack\Collision;
6
7
use Facade\IgnitionContracts\Solution;
8
use Yiisoft\FriendlyException\FriendlyExceptionInterface;
9
10
final class FriendlySolution implements Solution
11
{
12 2
    public function __construct(private FriendlyExceptionInterface $friendlyException)
13
    {
14
    }
15
16 1
    public function getSolutionTitle(): string
17
    {
18 1
        return $this->friendlyException->getName();
19
    }
20
21 2
    public function getSolutionDescription(): string
22
    {
23 2
        return $this->friendlyException->getSolution() ?? '';
24
    }
25
26 1
    public function getDocumentationLinks(): array
27
    {
28 1
        return [];
29
    }
30
}
31