@@ -78,10 +78,10 @@ public function __construct(Client $client, array $options = [])
7878 $ count = count ($ raw );
7979 $ result = [];
8080
81- if (isset ($ positions [1 ])) {
82-
83- foreach ($ positions as $ key => $ position ) {
84-
81+ if (isset ($ positions [1 ]))
82+ {
83+ foreach ($ positions as $ key => $ position )
84+ {
8585 // Get length of future block
8686 $ length = isset ($ positions [$ key + 1 ])
8787 ? $ positions [$ key + 1 ] - $ position + 1
@@ -90,8 +90,9 @@ public function __construct(Client $client, array $options = [])
9090 // Convert array to simple items, save as result
9191 $ result [] = array_slice ($ raw , $ position , $ length );
9292 }
93-
94- } else {
93+ }
94+ else
95+ {
9596 $ result = [$ raw ];
9697 }
9798
@@ -119,15 +120,18 @@ public function prev(): void
119120 *
120121 * @return mixed
121122 */
122- public function current ()
123+ public function current (): mixed
123124 {
124- if (isset ($ this ->parsed [$ this ->current ])) {
125+ if (isset ($ this ->parsed [$ this ->current ]))
126+ {
125127 return $ this ->parsed [$ this ->current ];
126128 }
127129
128- if ($ this ->valid ()) {
130+ if ($ this ->valid ())
131+ {
129132
130- if (!isset ($ this ->parsed [$ this ->current ])) {
133+ if (!isset ($ this ->parsed [$ this ->current ]))
134+ {
131135 $ value = $ this ->client ->parseResponse ($ this ->raw [$ this ->current ])[0 ];
132136 $ this ->offsetSet ($ this ->current , $ value );
133137 }
@@ -143,7 +147,7 @@ public function current()
143147 *
144148 * @return mixed
145149 */
146- public function key ()
150+ public function key (): mixed
147151 {
148152 return $ this ->current ;
149153 }
@@ -184,9 +188,12 @@ public function rewind(): void
184188 */
185189 public function offsetSet ($ offset , $ value ): void
186190 {
187- if (null === $ offset ) {
191+ if (null === $ offset )
192+ {
188193 $ this ->parsed [] = $ value ;
189- } else {
194+ }
195+ else
196+ {
190197 $ this ->parsed [$ offset ] = $ value ;
191198 }
192199 }
@@ -220,15 +227,18 @@ public function offsetUnset($offset): void
220227 *
221228 * @return bool|mixed
222229 */
223- public function offsetGet ($ offset )
230+ public function offsetGet ($ offset ): mixed
224231 {
225- if (isset ($ this ->parsed [$ offset ])) {
232+ if (isset ($ this ->parsed [$ offset ]))
233+ {
226234 return $ this ->parsed [$ offset ];
227235 }
228236
229- if (isset ($ this ->raw [$ offset ]) && $ this ->raw [$ offset ] !== null ) {
237+ if (isset ($ this ->raw [$ offset ]) && $ this ->raw [$ offset ] !== null )
238+ {
230239 $ f = $ this ->client ->parseResponse ($ this ->raw [$ offset ]);
231- if ($ f !== []) {
240+ if ($ f !== [])
241+ {
232242 return $ this ->parsed [$ offset ] = $ f [0 ];
233243 }
234244 }
@@ -253,6 +263,6 @@ public function serialize(): string
253263 */
254264 public function unserialize ($ serialized ): void
255265 {
256- $ this ->raw = unserialize ($ serialized, null );
266+ $ this ->raw = unserialize ($ serialized );
257267 }
258268}
0 commit comments