Passed
Push — master ( 71dbb5...c2c480 )
by Josh
02:11
created

Bencode   A

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 decode() 0 3 1
A encode() 0 3 1
A decodeNonCompliant() 0 3 1
1
<?php declare(strict_types=1);
2
3
/**
4
* @package   s9e\Bencode
5
* @copyright Copyright (c) 2014-2021 The s9e authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\Bencode;
9
10
class Bencode
11
{
12 72
	public static function decode(string $bencoded)
13
	{
14 72
		return Decoder::decode($bencoded);
15
	}
16
17 11
	public static function decodeNonCompliant(string $bencoded)
18
	{
19 11
		return NonCompliantDecoder::decode($bencoded);
20
	}
21
22 20
	public static function encode($value): string
23
	{
24 20
		return Encoder::encode($value);
25
	}
26
}