@@ -63,8 +63,7 @@ |
||
63 | 63 | elseif (is_array($options)) |
64 | 64 | { |
65 | 65 | $this->options = new Registry($options); |
66 | - } |
|
67 | - else |
|
66 | + } else |
|
68 | 67 | { |
69 | 68 | $this->options = new Registry; |
70 | 69 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | foreach ($suffixes as $suffix) |
184 | 184 | { |
185 | - $rawPath = str_replace('.', '/', $this->layoutId) . '.' . $suffix . '.php'; |
|
185 | + $rawPath = str_replace('.', '/', $this->layoutId) . '.' . $suffix . '.php'; |
|
186 | 186 | $this->addDebugMessage('<strong>Searching layout for:</strong> ' . $rawPath); |
187 | 187 | |
188 | 188 | if ($foundLayout = JPath::find($this->includePaths, $rawPath)) |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | // Standard version |
200 | - $rawPath = str_replace('.', '/', $this->layoutId) . '.php'; |
|
200 | + $rawPath = str_replace('.', '/', $this->layoutId) . '.php'; |
|
201 | 201 | $this->addDebugMessage('<strong>Searching layout for:</strong> ' . $rawPath); |
202 | 202 | |
203 | 203 | $foundLayout = JPath::find($this->includePaths, $rawPath); |
@@ -253,8 +253,7 @@ discard block |
||
253 | 253 | if (is_array($paths)) |
254 | 254 | { |
255 | 255 | $includePaths = array_unique(array_merge($paths, $includePaths)); |
256 | - } |
|
257 | - else |
|
256 | + } else |
|
258 | 257 | { |
259 | 258 | array_unshift($includePaths, $paths); |
260 | 259 | } |
@@ -591,8 +590,7 @@ discard block |
||
591 | 590 | if ($this->options->get('client') == 0) |
592 | 591 | { |
593 | 592 | $paths[] = JPATH_SITE . '/components/' . $component . '/layouts'; |
594 | - } |
|
595 | - else |
|
593 | + } else |
|
596 | 594 | { |
597 | 595 | $paths[] = JPATH_ADMINISTRATOR . '/components/' . $component . '/layouts'; |
598 | 596 | } |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | if (is_numeric($config['filter.published'])) |
56 | 56 | { |
57 | 57 | $query->where('a.published = ' . (int) $config['filter.published']); |
58 | - } |
|
59 | - elseif (is_array($config['filter.published'])) |
|
58 | + } elseif (is_array($config['filter.published'])) |
|
60 | 59 | { |
61 | 60 | ArrayHelper::toInteger($config['filter.published']); |
62 | 61 | $query->where('a.published IN (' . implode(',', $config['filter.published']) . ')'); |
@@ -69,8 +68,7 @@ discard block |
||
69 | 68 | if (is_string($config['filter.language'])) |
70 | 69 | { |
71 | 70 | $query->where('a.language = ' . $db->quote($config['filter.language'])); |
72 | - } |
|
73 | - elseif (is_array($config['filter.language'])) |
|
71 | + } elseif (is_array($config['filter.language'])) |
|
74 | 72 | { |
75 | 73 | foreach ($config['filter.language'] as &$language) |
76 | 74 | { |
@@ -125,8 +123,7 @@ discard block |
||
125 | 123 | if (is_numeric($config['filter.published'])) |
126 | 124 | { |
127 | 125 | $query->where('a.published = ' . (int) $config['filter.published']); |
128 | - } |
|
129 | - elseif (is_array($config['filter.published'])) |
|
126 | + } elseif (is_array($config['filter.published'])) |
|
130 | 127 | { |
131 | 128 | ArrayHelper::toInteger($config['filter.published']); |
132 | 129 | $query->where('a.published IN (' . implode(',', $config['filter.published']) . ')'); |
@@ -84,8 +84,7 @@ discard block |
||
84 | 84 | if (strpos($response->headers['Content-Type'], 'application/json') === 0) |
85 | 85 | { |
86 | 86 | $token = array_merge(json_decode($response->body, true), array('created' => time())); |
87 | - } |
|
88 | - else |
|
87 | + } else |
|
89 | 88 | { |
90 | 89 | parse_str($response->body, $token); |
91 | 90 | $token = array_merge($token, array('created' => time())); |
@@ -94,8 +93,7 @@ discard block |
||
94 | 93 | $this->setToken($token); |
95 | 94 | |
96 | 95 | return $token; |
97 | - } |
|
98 | - else |
|
96 | + } else |
|
99 | 97 | { |
100 | 98 | throw new RuntimeException('Error code ' . $response->code . ' received requesting access token: ' . $response->body . '.'); |
101 | 99 | } |
@@ -123,12 +121,10 @@ discard block |
||
123 | 121 | if (!$token || !array_key_exists('access_token', $token)) |
124 | 122 | { |
125 | 123 | return false; |
126 | - } |
|
127 | - elseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20) |
|
124 | + } elseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20) |
|
128 | 125 | { |
129 | 126 | return false; |
130 | - } |
|
131 | - else |
|
127 | + } else |
|
132 | 128 | { |
133 | 129 | return true; |
134 | 130 | } |
@@ -154,8 +150,7 @@ discard block |
||
154 | 150 | if (strpos($url, '?')) |
155 | 151 | { |
156 | 152 | $url .= '&'; |
157 | - } |
|
158 | - else |
|
153 | + } else |
|
159 | 154 | { |
160 | 155 | $url .= '?'; |
161 | 156 | } |
@@ -222,14 +217,12 @@ discard block |
||
222 | 217 | if (!$this->getOption('authmethod') || $this->getOption('authmethod') == 'bearer') |
223 | 218 | { |
224 | 219 | $headers['Authorization'] = 'Bearer ' . $token['access_token']; |
225 | - } |
|
226 | - elseif ($this->getOption('authmethod') == 'get') |
|
220 | + } elseif ($this->getOption('authmethod') == 'get') |
|
227 | 221 | { |
228 | 222 | if (strpos($url, '?')) |
229 | 223 | { |
230 | 224 | $url .= '&'; |
231 | - } |
|
232 | - else |
|
225 | + } else |
|
233 | 226 | { |
234 | 227 | $url .= '?'; |
235 | 228 | } |
@@ -369,8 +362,7 @@ discard block |
||
369 | 362 | if (strpos($response->headers['Content-Type'], 'application/json') === 0) |
370 | 363 | { |
371 | 364 | $token = array_merge(json_decode($response->body, true), array('created' => time())); |
372 | - } |
|
373 | - else |
|
365 | + } else |
|
374 | 366 | { |
375 | 367 | parse_str($response->body, $token); |
376 | 368 | $token = array_merge($token, array('created' => time())); |
@@ -379,8 +371,7 @@ discard block |
||
379 | 371 | $this->setToken($token); |
380 | 372 | |
381 | 373 | return $token; |
382 | - } |
|
383 | - else |
|
374 | + } else |
|
384 | 375 | { |
385 | 376 | throw new Exception('Error code ' . $response->code . ' received refreshing token: ' . $response->body . '.'); |
386 | 377 | } |
@@ -359,8 +359,7 @@ discard block |
||
359 | 359 | if ($parts[0] == 'J') |
360 | 360 | { |
361 | 361 | $this->type = StringHelper::ucfirst($parts[count($parts) - 1], '_'); |
362 | - } |
|
363 | - else |
|
362 | + } else |
|
364 | 363 | { |
365 | 364 | $this->type = StringHelper::ucfirst($parts[0], '_') . StringHelper::ucfirst($parts[count($parts) - 1], '_'); |
366 | 365 | } |
@@ -571,8 +570,7 @@ discard block |
||
571 | 570 | if (property_exists(__CLASS__, $name)) |
572 | 571 | { |
573 | 572 | JLog::add("Cannot access protected / private property $name of " . __CLASS__); |
574 | - } |
|
575 | - else |
|
573 | + } else |
|
576 | 574 | { |
577 | 575 | $this->$name = $value; |
578 | 576 | } |
@@ -666,8 +664,7 @@ discard block |
||
666 | 664 | { |
667 | 665 | $this->element['class'] = $elementClass . ' required'; |
668 | 666 | } |
669 | - } |
|
670 | - else |
|
667 | + } else |
|
671 | 668 | { |
672 | 669 | $this->element->addAttribute('class', 'required'); |
673 | 670 | } |
@@ -718,8 +715,7 @@ discard block |
||
718 | 715 | if ($id) |
719 | 716 | { |
720 | 717 | $id .= '_' . str_replace('.', '_', $this->group); |
721 | - } |
|
722 | - else |
|
718 | + } else |
|
723 | 719 | { |
724 | 720 | $id .= str_replace('.', '_', $this->group); |
725 | 721 | } |
@@ -729,8 +725,7 @@ discard block |
||
729 | 725 | if ($id) |
730 | 726 | { |
731 | 727 | $id .= '_' . ($fieldId ? $fieldId : $fieldName); |
732 | - } |
|
733 | - else |
|
728 | + } else |
|
734 | 729 | { |
735 | 730 | $id .= ($fieldId ? $fieldId : $fieldName); |
736 | 731 | } |
@@ -856,8 +851,7 @@ discard block |
||
856 | 851 | { |
857 | 852 | $name .= '[' . $group . ']'; |
858 | 853 | } |
859 | - } |
|
860 | - else |
|
854 | + } else |
|
861 | 855 | { |
862 | 856 | $name .= array_shift($groups); |
863 | 857 | |
@@ -872,8 +866,7 @@ discard block |
||
872 | 866 | if ($name) |
873 | 867 | { |
874 | 868 | $name .= '[' . $fieldName . ']'; |
875 | - } |
|
876 | - else |
|
869 | + } else |
|
877 | 870 | { |
878 | 871 | $name .= $fieldName; |
879 | 872 | } |
@@ -914,8 +907,7 @@ discard block |
||
914 | 907 | if ($fieldName) |
915 | 908 | { |
916 | 909 | return $fieldName; |
917 | - } |
|
918 | - else |
|
910 | + } else |
|
919 | 911 | { |
920 | 912 | self::$count = self::$count + 1; |
921 | 913 | |
@@ -1147,8 +1139,7 @@ discard block |
||
1147 | 1139 | if ($field->params->get('show_on') == 1 && (version_compare(JVERSION, '3.7', '<') ? $app->isAdmin() : $app->isClient('administrator'))) |
1148 | 1140 | { |
1149 | 1141 | return; |
1150 | - } |
|
1151 | - elseif ($field->params->get('show_on') == 2 |
|
1142 | + } elseif ($field->params->get('show_on') == 2 |
|
1152 | 1143 | && (version_compare(JVERSION, '3.7', '<') ? $app->isSite() : $app->isClient('site'))) |
1153 | 1144 | { |
1154 | 1145 | return; |
@@ -51,8 +51,7 @@ |
||
51 | 51 | if (is_numeric($country)) |
52 | 52 | { |
53 | 53 | $query->where('id = ' . (int) ($country)); |
54 | - } |
|
55 | - else |
|
54 | + } else |
|
56 | 55 | { |
57 | 56 | $query->where('alpha2 = ' . $db->q($country)); |
58 | 57 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | $db = JFactory::getDbo(); |
31 | 31 | |
32 | 32 | return array_map( |
33 | - function ($value) use ($db) { |
|
33 | + function($value) use ($db) { |
|
34 | 34 | return $db->quote($value); |
35 | 35 | }, |
36 | 36 | $values |
@@ -65,8 +65,7 @@ discard block |
||
65 | 65 | $open = false; |
66 | 66 | $char = ''; |
67 | 67 | } |
68 | - } |
|
69 | - else |
|
68 | + } else |
|
70 | 69 | { |
71 | 70 | $open = true; |
72 | 71 | $char = $current; |
@@ -148,8 +147,7 @@ discard block |
||
148 | 147 | { |
149 | 148 | $quoteChar = '"'; |
150 | 149 | $j = $k; |
151 | - } |
|
152 | - else |
|
150 | + } else |
|
153 | 151 | { |
154 | 152 | $quoteChar = "'"; |
155 | 153 | } |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | if (is_numeric($currency)) |
59 | 59 | { |
60 | 60 | $query->where('id = ' . (int) ($currency)); |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $query->where('alpha3 = ' . $db->q($currency)); |
65 | 64 | } |
@@ -145,8 +144,7 @@ discard block |
||
145 | 144 | if ($currency->symbol_position == 0 && $appendSymbol) |
146 | 145 | { |
147 | 146 | $price = $currency->symbol . $blankSpace . $price; |
148 | - } |
|
149 | - elseif ($currency->symbol_position == 1 && $appendSymbol) |
|
147 | + } elseif ($currency->symbol_position == 1 && $appendSymbol) |
|
150 | 148 | { |
151 | 149 | $price .= $blankSpace . $currency->symbol; |
152 | 150 | } |