PrivateKeyFileException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php declare(strict_types = 1);
2
3
namespace SlevomatEET\Cryptography;
4
5
use Exception;
6
use Throwable;
7
8
class PrivateKeyFileException extends Exception
9
{
10
11
	/** @var string */
12
	private $privateKeyFile;
13
14 2
	public function __construct(string $privateKeyFile, ?Throwable $previous = null)
15
	{
16 2
		parent::__construct(sprintf(
17 2
			'Private key could not be loaded from file \'%s\'. Please make sure that the file contains valid private key in PEM format.',
18
			$privateKeyFile
19 2
		), 0, $previous);
20
21 2
		$this->privateKeyFile = $privateKeyFile;
22 2
	}
23
24 1
	public function getPrivateKeyFile(): string
25
	{
26 1
		return $this->privateKeyFile;
27
	}
28
29
}
30