WorkBookCreateZipFileException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
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 RuntimeException;
8
9
final class WorkBookCreateZipFileException extends RuntimeException implements XlsxException
10
{
11
    private string $path;
12
13
    private int $returnCode;
14
15
    public function __construct(string $path, int $returnCode)
16
    {
17
        parent::__construct(sprintf('Unable to create zip file %s (err: %d)', $path, $returnCode));
18
        $this->path = $path;
19
        $this->returnCode = $returnCode;
20
    }
21
22
    public function getPath(): string
23
    {
24
        return $this->path;
25
    }
26
27
    public function getReturnCode(): int
28
    {
29
        return $this->returnCode;
30
    }
31
}
32