Passed
Push — master ( 0e9290...52a373 )
by Josh
02:21
created
tests/Test.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		fclose($fp);
193 193
 
194 194
 		return [
195
-			[function(){}],
195
+			[function () {}],
196 196
 			[1.2],
197 197
 			[$fp],
198 198
 		];
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 		$dict = Bencode::decode('d3:bar4:spam3:fooi42ee');
494 494
 
495 495
 		$this->assertSame('spam', $dict->bar);
496
-		$this->assertSame(42,     $dict['foo']);
496
+		$this->assertSame(42, $dict['foo']);
497 497
 
498 498
 		$actual = [];
499 499
 		foreach ($dict as $k => $v)
Please login to merge, or discard this patch.
src/Encoder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 		throw new EncodingException('Unsupported value', $value);
68 68
 	}
69 69
 
70
-	protected static function coerceUnsupportedValue($value): array|int|string
70
+	protected static function coerceUnsupportedValue($value): array | int | string
71 71
 	{
72 72
 		if (is_float($value))
73 73
 		{
Please login to merge, or discard this patch.
src/Decoder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	*/
35 35
 	protected int $offset = 0;
36 36
 
37
-	public static function decode(string $bencoded): ArrayObject|array|int|string
37
+	public static function decode(string $bencoded): ArrayObject | array | int | string
38 38
 	{
39 39
 		$decoder = new static($bencoded);
40 40
 		$value   = $decoder->decodeAnything();
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	{
61 61
 		if ($this->max < 1)
62 62
 		{
63
-			throw match ($this->bencoded[0])
63
+			throw match($this->bencoded[0])
64 64
 			{
65 65
 				'-', 'e' => new DecodingException('Illegal character', 0),
66 66
 				default  => new DecodingException('Premature end of data', $this->len - 1)
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 		}
114 114
 		while (str_contains('0123456789', $c) && --$boundary >= 0);
115 115
 
116
-		$this->max = match ($c)
116
+		$this->max = match($c)
117 117
 		{
118 118
 			'-'     => $boundary - 2,
119 119
 			'i'     => $boundary - 1,
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
 		$this->checkBoundary();
123 123
 	}
124 124
 
125
-	protected function decodeAnything(): ArrayObject|array|int|string
125
+	protected function decodeAnything(): ArrayObject | array | int | string
126 126
 	{
127
-		return match ($this->bencoded[$this->offset])
127
+		return match($this->bencoded[$this->offset])
128 128
 		{
129 129
 			'd'     => $this->decodeDictionary(),
130 130
 			'i'     => $this->decodeInteger(),
Please login to merge, or discard this patch.