Test Failed
Push — develop ( d71559...359c84 )
by Brent
06:20 queued 17s
created

StitcherException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 5
cts 9
cp 0.5556
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A title() 0 4 1
A body() 0 4 1
A __construct() 0 7 1
A fileNotFound() 0 4 1
1
<?php
2
3
namespace Stitcher\Exception;
4
5
use Exception;
6
7
class StitcherException extends Exception
8
{
9
    protected $title;
10
    protected $body;
11
12 2
    public function __construct(string $title, ?string $body = null)
13
    {
14 2
        parent::__construct($title);
15
16 2
        $this->title = $title;
17 2
        $this->body = $body;
18 2
    }
19
20
    public function title(): string
21
    {
22
        return $this->title;
23
    }
24
25
    public function body(): ?string
26
    {
27
        return $this->body;
28
    }
29
30
    public static function fileNotFound(string $path): StitcherException
31
    {
32
        return new self("File not found: {$path}");
33
    }
34
}
35