PrivateKeyFileException::getPrivateKeyFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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