Code Duplication    Length = 24-24 lines in 2 locations

src/Cryptography/PrivateKeyFileException.php 1 location

@@ 5-28 (lines=24) @@
2
3
namespace SlevomatEET\Cryptography;
4
5
class PrivateKeyFileException extends \Exception
6
{
7
8
	/**
9
	 * @var string
10
	 */
11
	private $privateKeyFile;
12
13
	public function __construct(string $privateKeyFile, \Throwable $previous = null)
14
	{
15
		parent::__construct(sprintf(
16
			'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
		), 0, $previous);
19
20
		$this->privateKeyFile = $privateKeyFile;
21
	}
22
23
	public function getPrivateKeyFile(): string
24
	{
25
		return $this->privateKeyFile;
26
	}
27
28
}
29

src/Cryptography/PublicKeyFileException.php 1 location

@@ 5-28 (lines=24) @@
2
3
namespace SlevomatEET\Cryptography;
4
5
class PublicKeyFileException extends \Exception
6
{
7
8
	/**
9
	 * @var string
10
	 */
11
	private $publicKeyFile;
12
13
	public function __construct(string $publicKeyFile, \Throwable $previous = null)
14
	{
15
		parent::__construct(sprintf(
16
			'Public key could not be loaded from file \'%s\'. Please make sure that the file contains valid public key in PEM format.',
17
			$publicKeyFile
18
		), 0, $previous);
19
20
		$this->publicKeyFile = $publicKeyFile;
21
	}
22
23
	public function getPublicKeyFile(): string
24
	{
25
		return $this->publicKeyFile;
26
	}
27
28
}
29