Test Setup Failed
Branch master (2a8314)
by Josh
02:40
created
src/Bencode.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
 					{
59 59
 						throw new RuntimeException('Illegal character found at offset ' . $pos);
60 60
 					}
61
-				}
62
-				elseif (!$spn)
61
+				} elseif (!$spn)
63 62
 				{
64 63
 					$pos -= ($negative) ? 2 : 1;
65 64
 
@@ -83,8 +82,7 @@  discard block
 block discarded – undo
83 82
 				}
84 83
 
85 84
 				++$pos;
86
-			}
87
-			elseif ($c === 'e')
85
+			} elseif ($c === 'e')
88 86
 			{
89 87
 				if (isset($currentKey))
90 88
 				{
@@ -106,18 +104,15 @@  discard block
 block discarded – undo
106 104
 				$currentType = $types[$depth - 1];
107 105
 
108 106
 				continue;
109
-			}
110
-			elseif ($c === 'd')
107
+			} elseif ($c === 'd')
111 108
 			{
112 109
 				++$pos;
113 110
 				$value = clone $dictionary;
114
-			}
115
-			elseif ($c === 'l')
111
+			} elseif ($c === 'l')
116 112
 			{
117 113
 				++$pos;
118 114
 				$value = [];
119
-			}
120
-			else
115
+			} else
121 116
 			{
122 117
 				$spn = strspn($bencoded, '1234567890', $pos);
123 118
 				if ($spn > 1)
@@ -126,8 +121,7 @@  discard block
 block discarded – undo
126 121
 					{
127 122
 						throw new RuntimeException('Illegal character found at offset ' . $pos);
128 123
 					}
129
-				}
130
-				elseif (!$spn)
124
+				} elseif (!$spn)
131 125
 				{
132 126
 					throw new RuntimeException('Illegal character found at offset ' . $pos);
133 127
 				}
@@ -153,8 +147,7 @@  discard block
 block discarded – undo
153 147
 				}
154 148
 				$current->$currentKey = &$value;
155 149
 				$currentKey = null;
156
-			}
157
-			elseif ($currentType === 'd')
150
+			} elseif ($currentType === 'd')
158 151
 			{
159 152
 				if (!is_string($value))
160 153
 				{
@@ -162,16 +155,13 @@  discard block
 block discarded – undo
162 155
 				}
163 156
 
164 157
 				$currentKey = $value;
165
-			}
166
-			elseif ($currentType === 'l')
158
+			} elseif ($currentType === 'l')
167 159
 			{
168 160
 				$current[] = &$value;
169
-			}
170
-			elseif (isset($current))
161
+			} elseif (isset($current))
171 162
 			{
172 163
 				throw new RuntimeException('Superfluous content found at offset ' . strlen(static::encode($current)));
173
-			}
174
-			else
164
+			} else
175 165
 			{
176 166
 				$current = &$value;
177 167
 			}
@@ -310,8 +300,7 @@  discard block
 block discarded – undo
310 300
 		if ($c === '-' && $boundary > 0 && $bencoded[$boundary - 1] === 'i')
311 301
 		{
312 302
 			$boundary -= 2;
313
-		}
314
-		elseif ($c === 'i')
303
+		} elseif ($c === 'i')
315 304
 		{
316 305
 			--$boundary;
317 306
 		}
Please login to merge, or discard this patch.