PrivateKeyFileException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 19
rs 10
ccs 9
cts 9
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPrivateKeyFile() 0 3 1
A __construct() 0 8 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