EncodingException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A __construct() 0 4 1
1
<?php declare(strict_types=1);
2
3
/**
4
* @package   s9e\Bencode
5
* @copyright Copyright (c) The s9e authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\Bencode\Exceptions;
9
10
use InvalidArgumentException;
11
12
class EncodingException extends InvalidArgumentException
13
{
14
	/**
15
	* @var mixed Value that caused this exception to be thrown
16
	*/
17
	protected mixed $value;
18
19 2
	public function __construct(string $message, mixed $value)
20
	{
21 2
		$this->value = $value;
22 2
		parent::__construct($message);
23
	}
24
25
	/**
26
	* Return the value that caused this exception to be thrown
27
	*
28
	* @return mixed
29
	*/
30 1
	public function getValue()
31
	{
32 1
		return $this->value;
33
	}
34
}