@@ -41,8 +41,7 @@ |
||
41 | 41 | if($this->hasScheme()) |
42 | 42 | { |
43 | 43 | $this->setScheme(strtolower($this->getScheme())); |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | $scheme = URISchemes::detectScheme($this->url); |
48 | 47 | if(!empty($scheme)) { |
@@ -285,8 +285,7 @@ |
||
285 | 285 | if(is_array($val)) |
286 | 286 | { |
287 | 287 | $val = $this->restoreUnicodeChars($val); |
288 | - } |
|
289 | - else |
|
288 | + } else |
|
290 | 289 | { |
291 | 290 | $val = $this->restoreUnicodeChar($val); |
292 | 291 | } |
@@ -50,13 +50,11 @@ |
||
50 | 50 | { |
51 | 51 | return $value; |
52 | 52 | } |
53 | - } |
|
54 | - else if (is_array(json_decode($value, true, 512, JSON_THROW_ON_ERROR))) |
|
53 | + } else if (is_array(json_decode($value, true, 512, JSON_THROW_ON_ERROR))) |
|
55 | 54 | { |
56 | 55 | return $value; |
57 | 56 | } |
58 | - } |
|
59 | - catch (Throwable $e) |
|
57 | + } catch (Throwable $e) |
|
60 | 58 | { |
61 | 59 | // Invalid JSON must return an empty string. |
62 | 60 | // The application is responsible for asserting |
@@ -40,8 +40,7 @@ |
||
40 | 40 | if($error instanceof XMLHelper_DOMErrors_Error) |
41 | 41 | { |
42 | 42 | $this->errors[] = $error; |
43 | - } |
|
44 | - else if($error instanceof LibXMLError) |
|
43 | + } else if($error instanceof LibXMLError) |
|
45 | 44 | { |
46 | 45 | $this->errors[] = new XMLHelper_DOMErrors_Error($error); |
47 | 46 | } |
@@ -58,8 +58,7 @@ |
||
58 | 58 | try |
59 | 59 | { |
60 | 60 | $data = json_decode($serialized, true, 512, JSON_THROW_ON_ERROR); |
61 | - } |
|
62 | - catch (JsonException $e) |
|
61 | + } catch (JsonException $e) |
|
63 | 62 | { |
64 | 63 | throw new XMLHelper_Exception( |
65 | 64 | 'Could not unserialize error data', |
@@ -137,8 +137,7 @@ discard block |
||
137 | 137 | $this->sourceImage = $resource; |
138 | 138 | $this->type = $type; |
139 | 139 | $this->info = self::getImageSize($resource); |
140 | - } |
|
141 | - else |
|
140 | + } else |
|
142 | 141 | { |
143 | 142 | $this->file = $sourceFile; |
144 | 143 | if (!file_exists($this->file)) { |
@@ -580,8 +579,7 @@ discard block |
||
580 | 579 | if ($this->width <= $this->height) |
581 | 580 | { |
582 | 581 | $this->resampleByWidth($width); |
583 | - } |
|
584 | - else |
|
582 | + } else |
|
585 | 583 | { |
586 | 584 | $this->resampleByHeight($height); |
587 | 585 | } |
@@ -301,8 +301,7 @@ discard block |
||
301 | 301 | try |
302 | 302 | { |
303 | 303 | return new DateTime($value); |
304 | - } |
|
305 | - catch (Exception $e) |
|
304 | + } catch (Exception $e) |
|
306 | 305 | { |
307 | 306 | return null; |
308 | 307 | } |
@@ -320,8 +319,7 @@ discard block |
||
320 | 319 | try |
321 | 320 | { |
322 | 321 | return Microtime::createFromString($this->getString($name)); |
323 | - } |
|
324 | - catch (Exception $e) |
|
322 | + } catch (Exception $e) |
|
325 | 323 | { |
326 | 324 | return null; |
327 | 325 | } |
@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | try |
47 | 47 | { |
48 | 48 | return json_encode($variable, JSON_THROW_ON_ERROR | $options, $depth); |
49 | - } |
|
50 | - catch (JsonException $e) |
|
49 | + } catch (JsonException $e) |
|
51 | 50 | { |
52 | 51 | throw new JSONConverterException( |
53 | 52 | 'Could not create json array'.json_last_error_msg(), |
@@ -78,8 +77,7 @@ discard block |
||
78 | 77 | try |
79 | 78 | { |
80 | 79 | return json_decode($json, $assoc, 512, JSON_THROW_ON_ERROR); |
81 | - } |
|
82 | - catch (JsonException $e) |
|
80 | + } catch (JsonException $e) |
|
83 | 81 | { |
84 | 82 | throw new JSONConverterException( |
85 | 83 | 'Could not decode JSON string.', |
@@ -149,8 +147,7 @@ discard block |
||
149 | 147 | try |
150 | 148 | { |
151 | 149 | return self::json2array($json); |
152 | - } |
|
153 | - catch (JSONConverterException $e) |
|
150 | + } catch (JSONConverterException $e) |
|
154 | 151 | { |
155 | 152 | return array(); |
156 | 153 | } |
@@ -170,8 +167,7 @@ discard block |
||
170 | 167 | try |
171 | 168 | { |
172 | 169 | return self::var2json($variable, $options, $depth); |
173 | - } |
|
174 | - catch (JSONConverterException $e) |
|
170 | + } catch (JSONConverterException $e) |
|
175 | 171 | { |
176 | 172 | return ''; |
177 | 173 | } |
@@ -190,8 +186,7 @@ discard block |
||
190 | 186 | try |
191 | 187 | { |
192 | 188 | return self::json2var($json, $assoc); |
193 | - } |
|
194 | - catch (JSONConverterException $e) |
|
189 | + } catch (JSONConverterException $e) |
|
195 | 190 | { |
196 | 191 | return null; |
197 | 192 | } |
@@ -86,8 +86,7 @@ discard block |
||
86 | 86 | try |
87 | 87 | { |
88 | 88 | return self::fromElement(new SimpleXMLElement($xmlString)); |
89 | - } |
|
90 | - catch (Exception $e) |
|
89 | + } catch (Exception $e) |
|
91 | 90 | { |
92 | 91 | throw new XMLHelper_Exception( |
93 | 92 | 'Cannot create new element from string.', |
@@ -142,8 +141,7 @@ discard block |
||
142 | 141 | unset($this->xml); |
143 | 142 | |
144 | 143 | return $this->json; |
145 | - } |
|
146 | - catch (JSONConverterException $e) |
|
144 | + } catch (JSONConverterException $e) |
|
147 | 145 | { |
148 | 146 | throw new XMLHelper_Exception( |
149 | 147 | 'Could not convert the XML source to JSON.', |
@@ -171,8 +169,7 @@ discard block |
||
171 | 169 | try |
172 | 170 | { |
173 | 171 | return JSONConverter::json2array($this->toJSON()); |
174 | - } |
|
175 | - catch (JSONConverterException $e) |
|
172 | + } catch (JSONConverterException $e) |
|
176 | 173 | { |
177 | 174 | throw new XMLHelper_Exception( |
178 | 175 | 'Could not convert the JSON string to an array.', |