InvalidWorkSheetNameException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Eclipxe\XlsxExporter\Exceptions;
6
7
use LogicException;
8
9
final class InvalidWorkSheetNameException extends LogicException implements XlsxException
10
{
11
    private string $name;
12
13
    private string $reason;
14
15 14
    public function __construct(string $name, string $reason)
16
    {
17 14
        parent::__construct("Invalid worksheet name '$name': $reason");
18 14
        $this->name = $name;
19 14
        $this->reason = $reason;
20
    }
21
22
    public function getName(): string
23
    {
24
        return $this->name;
25
    }
26
27
    public function getReason(): string
28
    {
29
        return $this->reason;
30
    }
31
}
32