DecodingException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOffset() 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 RuntimeException;
11
12
class DecodingException extends RuntimeException
13
{
14
	protected int $offset;
15
16 2
	public function __construct(string $message, int $offset)
17
	{
18 2
		$this->offset = $offset;
19 2
		parent::__construct($message . ' at offset ' . $offset);
20
	}
21
22 1
	public function getOffset(): int
23
	{
24 1
		return $this->offset;
25
	}
26
}