Passed
Push — master ( b500c8...f1f1b3 )
by Hirofumi
05:29
created

LoadFailedException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Shippinno\Template;
5
6
use Exception;
7
use Throwable;
8
9
class LoadFailedException extends Exception
10
{
11
    /**
12
     * @var string
13
     */
14
    private $fileName;
15
16
    /**
17
     * @param string $fileName
18
     */
19 1
    public function __construct(string $fileName)
20
    {
21 1
        $this->fileName = $fileName;
22 1
        parent::__construct(sprintf('Failed to load file: %s', $this->fileName()));
23 1
    }
24
25
    /**
26
     * @return string
27
     */
28 1
    public function fileName(): string
29
    {
30 1
        return $this->fileName;
31
    }
32
}
33