Bencode::decodeNonCompliant()   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 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) 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
}