@@ -133,8 +133,7 @@ discard block |
||
133 | 133 | empty($this->MultipleActiveResultSets) OR $this->dsn .= ';MultipleActiveResultSets='.$this->MultipleActiveResultSets; |
134 | 134 | empty($this->TraceFile) OR $this->dsn .= ';TraceFile='.$this->TraceFile; |
135 | 135 | empty($this->WSID) OR $this->dsn .= ';WSID='.$this->WSID; |
136 | - } |
|
137 | - elseif (preg_match('/QuotedId=(0|1)/', $this->dsn, $match)) |
|
136 | + } elseif (preg_match('/QuotedId=(0|1)/', $this->dsn, $match)) |
|
138 | 137 | { |
139 | 138 | $this->_quoted_identifier = (bool) $match[1]; |
140 | 139 | } |
@@ -319,8 +318,7 @@ discard block |
||
319 | 318 | if (count($this->qb_select) === 0) |
320 | 319 | { |
321 | 320 | $select = '*'; // Inevitable |
322 | - } |
|
323 | - else |
|
321 | + } else |
|
324 | 322 | { |
325 | 323 | // Use only field names and their aliases, everything else is out of our scope. |
326 | 324 | $select = array(); |
@@ -319,8 +319,7 @@ discard block |
||
319 | 319 | if (is_php('5.4.4') && (is_string($str) OR (is_object($str) && method_exists($str, '__toString')))) |
320 | 320 | { |
321 | 321 | return pg_escape_literal($this->conn_id, $str); |
322 | - } |
|
323 | - elseif (is_bool($str)) |
|
322 | + } elseif (is_bool($str)) |
|
324 | 323 | { |
325 | 324 | return ($str) ? 'TRUE' : 'FALSE'; |
326 | 325 | } |
@@ -358,8 +357,7 @@ discard block |
||
358 | 357 | if ($table === NULL && $v >= '8.1') |
359 | 358 | { |
360 | 359 | $sql = 'SELECT LASTVAL() AS ins_id'; |
361 | - } |
|
362 | - elseif ($table !== NULL) |
|
360 | + } elseif ($table !== NULL) |
|
363 | 361 | { |
364 | 362 | if ($column !== NULL && $v >= '8.0') |
365 | 363 | { |
@@ -367,16 +365,14 @@ discard block |
||
367 | 365 | $query = $this->query($sql); |
368 | 366 | $query = $query->row(); |
369 | 367 | $seq = $query->seq; |
370 | - } |
|
371 | - else |
|
368 | + } else |
|
372 | 369 | { |
373 | 370 | // seq_name passed in table parameter |
374 | 371 | $seq = $table; |
375 | 372 | } |
376 | 373 | |
377 | 374 | $sql = 'SELECT CURRVAL(\''.$seq."') AS ins_id"; |
378 | - } |
|
379 | - else |
|
375 | + } else |
|
380 | 376 | { |
381 | 377 | return pg_last_oid($this->result_id); |
382 | 378 | } |
@@ -95,8 +95,7 @@ |
||
95 | 95 | if ( ! file_exists($this->db->database) OR ! @unlink($this->db->database)) |
96 | 96 | { |
97 | 97 | return ($this->db->db_debug) ? $this->db->display_error('db_unable_to_drop') : FALSE; |
98 | - } |
|
99 | - elseif ( ! empty($this->db->data_cache['db_names'])) |
|
98 | + } elseif ( ! empty($this->db->data_cache['db_names'])) |
|
100 | 99 | { |
101 | 100 | $key = array_search(strtolower($this->db->database), array_map('strtolower', $this->db->data_cache['db_names']), TRUE); |
102 | 101 | if ($key !== FALSE) |
@@ -88,8 +88,7 @@ |
||
88 | 88 | return ( ! $this->password) |
89 | 89 | ? new SQLite3($this->database) |
90 | 90 | : new SQLite3($this->database, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, $this->password); |
91 | - } |
|
92 | - catch (Exception $e) |
|
91 | + } catch (Exception $e) |
|
93 | 92 | { |
94 | 93 | return FALSE; |
95 | 94 | } |
@@ -112,8 +112,7 @@ |
||
112 | 112 | if ( ! @unlink($this->db->database)) |
113 | 113 | { |
114 | 114 | return $this->db->db_debug ? $this->db->display_error('db_unable_to_drop') : FALSE; |
115 | - } |
|
116 | - elseif ( ! empty($this->db->data_cache['db_names'])) |
|
115 | + } elseif ( ! empty($this->db->data_cache['db_names'])) |
|
117 | 116 | { |
118 | 117 | $key = array_search(strtolower($this->db->database), array_map('strtolower', $this->db->data_cache['db_names']), TRUE); |
119 | 118 | if ($key !== FALSE) |
@@ -158,8 +158,7 @@ |
||
158 | 158 | if (($row = $this->result_id->fetchArray(SQLITE3_ASSOC)) === FALSE) |
159 | 159 | { |
160 | 160 | return FALSE; |
161 | - } |
|
162 | - elseif ($class_name === 'stdClass') |
|
161 | + } elseif ($class_name === 'stdClass') |
|
163 | 162 | { |
164 | 163 | return (object) $row; |
165 | 164 | } |
@@ -375,8 +375,7 @@ discard block |
||
375 | 375 | if (isset($sqlsrv_error['SQLSTATE'])) |
376 | 376 | { |
377 | 377 | $error['code'] = isset($sqlsrv_error['code']) ? $sqlsrv_error['SQLSTATE'].'/'.$sqlsrv_error['code'] : $sqlsrv_error['SQLSTATE']; |
378 | - } |
|
379 | - elseif (isset($sqlsrv_error['code'])) |
|
378 | + } elseif (isset($sqlsrv_error['code'])) |
|
380 | 379 | { |
381 | 380 | $error['code'] = $sqlsrv_error['code']; |
382 | 381 | } |
@@ -480,8 +479,7 @@ discard block |
||
480 | 479 | if (count($this->qb_select) === 0) |
481 | 480 | { |
482 | 481 | $select = '*'; // Inevitable |
483 | - } |
|
484 | - else |
|
482 | + } else |
|
485 | 483 | { |
486 | 484 | // Use only field names and their aliases, everything else is out of our scope. |
487 | 485 | $select = array(); |
@@ -87,8 +87,7 @@ discard block |
||
87 | 87 | if ( ! is_array($data) && empty($$key)) |
88 | 88 | { |
89 | 89 | $$key = $val; |
90 | - } |
|
91 | - else |
|
90 | + } else |
|
92 | 91 | { |
93 | 92 | $$key = isset($data[$key]) ? $data[$key] : $val; |
94 | 93 | } |
@@ -137,8 +136,7 @@ discard block |
||
137 | 136 | { |
138 | 137 | $word .= $pool[random_int(0, $rand_max)]; |
139 | 138 | } |
140 | - } |
|
141 | - catch (Exception $e) |
|
139 | + } catch (Exception $e) |
|
142 | 140 | { |
143 | 141 | // This means fallback to the next possible |
144 | 142 | // alternative to random_int() |
@@ -215,8 +213,7 @@ discard block |
||
215 | 213 | { |
216 | 214 | $word .= $pool[mt_rand(0, $rand_max)]; |
217 | 215 | } |
218 | - } |
|
219 | - elseif ( ! is_string($word)) |
|
216 | + } elseif ( ! is_string($word)) |
|
220 | 217 | { |
221 | 218 | $word = (string) $word; |
222 | 219 | } |
@@ -284,8 +281,7 @@ discard block |
||
284 | 281 | ($font_size > 5) && $font_size = 5; |
285 | 282 | $x = mt_rand(0, $img_width / ($length / 3)); |
286 | 283 | $y = 0; |
287 | - } |
|
288 | - else |
|
284 | + } else |
|
289 | 285 | { |
290 | 286 | ($font_size > 30) && $font_size = 30; |
291 | 287 | $x = mt_rand(0, $img_width / ($length / 1.5)); |
@@ -299,8 +295,7 @@ discard block |
||
299 | 295 | $y = mt_rand(0 , $img_height / 2); |
300 | 296 | imagestring($im, $font_size, $x, $y, $word[$i], $colors['text']); |
301 | 297 | $x += ($font_size * 2); |
302 | - } |
|
303 | - else |
|
298 | + } else |
|
304 | 299 | { |
305 | 300 | $y = mt_rand($img_height / 2, $img_height - 3); |
306 | 301 | imagettftext($im, $font_size, $angle, $x, $y, $colors['text'], $font_path, $word[$i]); |
@@ -320,13 +315,11 @@ discard block |
||
320 | 315 | { |
321 | 316 | $img_filename = $now.'.jpg'; |
322 | 317 | imagejpeg($im, $img_path.$img_filename); |
323 | - } |
|
324 | - elseif (function_exists('imagepng')) |
|
318 | + } elseif (function_exists('imagepng')) |
|
325 | 319 | { |
326 | 320 | $img_filename = $now.'.png'; |
327 | 321 | imagepng($im, $img_path.$img_filename); |
328 | - } |
|
329 | - else |
|
322 | + } else |
|
330 | 323 | { |
331 | 324 | return FALSE; |
332 | 325 | } |
@@ -104,8 +104,7 @@ discard block |
||
104 | 104 | if ($datestr === '') |
105 | 105 | { |
106 | 106 | return ''; |
107 | - } |
|
108 | - elseif (empty($time)) |
|
107 | + } elseif (empty($time)) |
|
109 | 108 | { |
110 | 109 | $time = now(); |
111 | 110 | } |
@@ -283,8 +282,7 @@ discard block |
||
283 | 282 | if ($month < 1 OR $month > 12) |
284 | 283 | { |
285 | 284 | return 0; |
286 | - } |
|
287 | - elseif ( ! is_numeric($year) OR strlen($year) !== 4) |
|
285 | + } elseif ( ! is_numeric($year) OR strlen($year) !== 4) |
|
288 | 286 | { |
289 | 287 | $year = date('Y'); |
290 | 288 | } |
@@ -420,8 +418,7 @@ discard block |
||
420 | 418 | if ($fmt === 'us') |
421 | 419 | { |
422 | 420 | $r .= date('h', $time).':'.date('i', $time); |
423 | - } |
|
424 | - else |
|
421 | + } else |
|
425 | 422 | { |
426 | 423 | $r .= date('H', $time).':'.date('i', $time); |
427 | 424 | } |
@@ -477,8 +474,7 @@ discard block |
||
477 | 474 | if ($ampm[0] === 'p' && $hour < 12) |
478 | 475 | { |
479 | 476 | $hour += 12; |
480 | - } |
|
481 | - elseif ($ampm[0] === 'a' && $hour === 12) |
|
477 | + } elseif ($ampm[0] === 'a' && $hour === 12) |
|
482 | 478 | { |
483 | 479 | $hour = 0; |
484 | 480 | } |
@@ -505,8 +501,7 @@ discard block |
||
505 | 501 | if (empty($bad_date)) |
506 | 502 | { |
507 | 503 | return 'Unknown'; |
508 | - } |
|
509 | - elseif (empty($format)) |
|
504 | + } elseif (empty($format)) |
|
510 | 505 | { |
511 | 506 | $format = 'U'; |
512 | 507 | } |
@@ -518,8 +513,7 @@ discard block |
||
518 | 513 | { |
519 | 514 | $year = substr($bad_date, 0, 4); |
520 | 515 | $month = substr($bad_date, 4, 2); |
521 | - } |
|
522 | - else |
|
516 | + } else |
|
523 | 517 | { |
524 | 518 | $month = substr($bad_date, 0, 2); |
525 | 519 | $year = substr($bad_date, 2, 4); |
@@ -732,8 +726,7 @@ discard block |
||
732 | 726 | { |
733 | 727 | $arg = new DateTime(); |
734 | 728 | $arg->setTimestamp($mixed); |
735 | - } |
|
736 | - else |
|
729 | + } else |
|
737 | 730 | { |
738 | 731 | $arg = (int) $mixed; |
739 | 732 | } |
@@ -764,23 +757,23 @@ discard block |
||
764 | 757 | $arg = new DateTime(); |
765 | 758 | $arg->setDate(date('Y', $mixed), date('n', $mixed), date('j', $mixed)); |
766 | 759 | $arg->setTime(date('G', $mixed), date('i', $mixed), date('s', $mixed)); |
767 | - } |
|
768 | - else |
|
760 | + } else |
|
769 | 761 | { |
770 | 762 | $arg = (int) $mixed; |
771 | 763 | } |
772 | 764 | $range[] = $from->format($format); |
773 | 765 | |
774 | - if (is_int($arg)) // Day intervals |
|
766 | + if (is_int($arg)) { |
|
767 | + // Day intervals |
|
775 | 768 | { |
776 | 769 | do |
777 | 770 | { |
778 | 771 | $from->modify('+1 day'); |
772 | + } |
|
779 | 773 | $range[] = $from->format($format); |
780 | 774 | } |
781 | 775 | while (--$arg > 0); |
782 | - } |
|
783 | - else // end date UNIX timestamp |
|
776 | + } else // end date UNIX timestamp |
|
784 | 777 | { |
785 | 778 | for ($from->modify('+1 day'), $end_check = $arg->format('Ymd'); $from->format('Ymd') < $end_check; $from->modify('+1 day')) |
786 | 779 | { |