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

Bencode::decodeNonCompliant()   A

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 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
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) 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
}