Bencode   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 0
Metric Value
eloc 4
c 5
b 0
f 0
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A encode() 0 3 1
A decode() 0 3 1
A decodeNonCompliant() 0 3 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;
9
10
use ArrayObject;
11
12
class Bencode
13
{
14 1
	public static function decode(string $bencoded): ArrayObject|array|int|string
15
	{
16 1
		return Decoder::decode($bencoded);
17
	}
18
19 1
	public static function decodeNonCompliant(string $bencoded): ArrayObject|array|int|string
20
	{
21 1
		return NonCompliantDecoder::decode($bencoded);
22
	}
23
24 1
	public static function encode(mixed $value): string
25
	{
26 1
		return Encoder::encode($value);
27
	}
28
}