Completed
Push — master ( fa5ac7...eb2a5f )
by Jan
06:08
created

PrivateKeyFileException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

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