EncodingException::getValue()   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
ccs 2
cts 2
cp 1
crap 1
rs 10
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
}