VerificationFailedException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 35
rs 10
ccs 11
cts 11
cp 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorMessage() 0 3 1
A __construct() 0 9 1
A getData() 0 3 1
1
<?php declare(strict_types = 1);
2
3
namespace SlevomatCsobGateway\Crypto;
4
5
use RuntimeException;
6
use function sprintf;
7
8
class VerificationFailedException extends RuntimeException
9
{
10
11
	/** @var mixed[] */
12
	private $data;
13
14
	/** @var string */
15
	private $errorMessage;
16
17
	/**
18
	 * @param mixed[] $data
19
	 * @param string $errorMessage
20
	 */
21 1
	public function __construct(array $data, string $errorMessage)
22
	{
23 1
		parent::__construct(sprintf(
24 1
			'Verification failed: %s',
25 1
			$errorMessage
26
		));
27
28 1
		$this->data = $data;
29 1
		$this->errorMessage = $errorMessage;
30 1
	}
31
32
	/**
33
	 * @return mixed[]
34
	 */
35 1
	public function getData(): array
36
	{
37 1
		return $this->data;
38
	}
39
40 1
	public function getErrorMessage(): string
41
	{
42 1
		return $this->errorMessage;
43
	}
44
45
}
46