Completed
Push — master ( e89277...1caf4d )
by Patrick
03:08
created
Data/class.SQLDataSet.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@  discard block
 block discarded – undo
10 10
         if(isset($params['user']))
11 11
         {
12 12
             $this->pdo = new \PDO($params['dsn'], $params['user'], $params['pass']);
13
-        }
14
-        else
13
+        } else
15 14
         {
16 15
             $this->pdo = new \PDO($params['dsn']);
17 16
         }
@@ -38,8 +37,7 @@  discard block
 block discarded – undo
38 37
         if($this->_get_row_count_for_query('SHOW TABLES LIKE '.$this->pdo->quote($name)) > 0)
39 38
         {
40 39
             return true;
41
-        }
42
-        else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote($name)) > 0)
40
+        } else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote($name)) > 0)
43 41
         {
44 42
             return true;
45 43
         }
@@ -51,8 +49,7 @@  discard block
 block discarded – undo
51 49
         if($this->_get_row_count_for_query('SHOW TABLES LIKE '.$this->pdo->quote('tbl'.$name)) > 0)
52 50
         {
53 51
             return true;
54
-        }
55
-        else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote('tbl'.$name)) > 0)
52
+        } else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote('tbl'.$name)) > 0)
56 53
         {
57 54
             return true;
58 55
         }
@@ -64,8 +61,7 @@  discard block
 block discarded – undo
64 61
         if($this->_get_row_count_for_query('SHOW TABLES LIKE '.$this->pdo->quote('v'.$name)) > 0)
65 62
         {
66 63
             return true;
67
-        }
68
-        else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote('v'.$name)) > 0)
64
+        } else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote('v'.$name)) > 0)
69 65
         {
70 66
             return true;
71 67
         }
@@ -122,8 +118,7 @@  discard block
 block discarded – undo
122 118
             if($skip === false)
123 119
             {
124 120
                 $sql.=' LIMIT '.(int)$count;
125
-            }
126
-            else
121
+            } else
127 122
             {
128 123
                 $sql.=" LIMIT $skip, $count";
129 124
             }
Please login to merge, or discard this patch.
Data/class.Filter.php 1 patch
Braces   +20 added lines, -25 removed lines patch added patch discarded remove patch
@@ -30,11 +30,15 @@  discard block
 block discarded – undo
30 30
             return array(new FilterClause($string));
31 31
         }
32 32
         $children = array();
33
-        if($parens) array_push($children, '(');
33
+        if($parens) {
34
+            array_push($children, '(');
35
+        }
34 36
         $children = array_merge($children, self::process_string($clauses[1]));
35 37
         array_push($children, trim($clauses[2]));
36 38
         $children = array_merge($children, self::process_string($clauses[3]));
37
-        if($parens) array_push($children, ')');
39
+        if($parens) {
40
+            array_push($children, ')');
41
+        }
38 42
         return $children;
39 43
     }
40 44
 
@@ -47,16 +51,13 @@  discard block
 block discarded – undo
47 51
             if($this->children[$i] === '(' || $this->children[$i] === ')')
48 52
             {
49 53
                 $ret.=$this->children[$i];
50
-            }
51
-            else if($this->children[$i] === 'and')
54
+            } else if($this->children[$i] === 'and')
52 55
             {
53 56
                 $ret.=' AND ';
54
-            }
55
-            else if($this->children[$i] === 'or')
57
+            } else if($this->children[$i] === 'or')
56 58
             {
57 59
                 $ret.=' OR ';
58
-            }
59
-            else
60
+            } else
60 61
             {
61 62
                 $ret.=$this->children[$i]->to_sql_string();
62 63
             }
@@ -78,16 +79,14 @@  discard block
 block discarded – undo
78 79
                     throw new \Exception('Do not support both and or');
79 80
                 }
80 81
                 $prefix = '&';
81
-            }
82
-            else if($this->children[$i] === 'or')
82
+            } else if($this->children[$i] === 'or')
83 83
             {
84 84
                 if($prefix == '&')
85 85
                 {
86 86
                     throw new \Exception('Do not support both and or');
87 87
                 }
88 88
                 $prefix = '|';
89
-            }
90
-            else
89
+            } else
91 90
             {
92 91
                 $ret.=$this->children[$i]->to_ldap_string();
93 92
             }
@@ -109,13 +108,11 @@  discard block
 block discarded – undo
109 108
             {
110 109
                 $old = array_pop($ret);
111 110
                 array_push($ret, array('$and'=>array($old, $this->children[++$i]->to_mongo_filter())));
112
-            }
113
-            else if($this->children[$i] === 'or')
111
+            } else if($this->children[$i] === 'or')
114 112
             {
115 113
                 $old = array_pop($ret);
116 114
                 array_push($ret, array('$or'=>array($old, $this->children[++$i]->to_mongo_filter())));
117
-            }
118
-            else
115
+            } else
119 116
             {
120 117
                 array_push($ret, $this->children[$i]->to_mongo_filter());
121 118
             }
@@ -140,12 +137,10 @@  discard block
 block discarded – undo
140 137
                 if($this->children[$i] === 'and')
141 138
                 {
142 139
                     $search = $res;
143
-                }
144
-                else if($this->children[$i] === 'or')
140
+                } else if($this->children[$i] === 'or')
145 141
                 {
146 142
                     $search = $array;
147
-                }
148
-                else
143
+                } else
149 144
                 {
150 145
                     foreach($search as $subarray)
151 146
                     {
@@ -173,7 +168,9 @@  discard block
 block discarded – undo
173 168
         $count = count($this->children);
174 169
         for($i = 0; $i < $count; $i++)
175 170
         {
176
-            if(!is_object($this->children[$i])) continue;
171
+            if(!is_object($this->children[$i])) {
172
+                continue;
173
+            }
177 174
             if(strstr($this->children[$i]->var1, $substr) !== false ||
178 175
                strstr($this->children[$i]->var2, $substr) !== false)
179 176
             {
@@ -193,12 +190,10 @@  discard block
 block discarded – undo
193 190
         {
194 191
             array_push($this->children, $child);
195 192
             return;
196
-        }
197
-        else if(is_a($child, '\Data\Filter'))
193
+        } else if(is_a($child, '\Data\Filter'))
198 194
         {
199 195
             $this->children = array_merge($this->children, $child->children);
200
-        }
201
-        else
196
+        } else
202 197
         {
203 198
             $this->children = array_merge($this->children, self::process_string($child));
204 199
         }
Please login to merge, or discard this patch.
Data/class.MongoDataTable.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@  discard block
 block discarded – undo
11 11
         if($collection_name !== false)
12 12
         {
13 13
             $this->namespace = $collection.'.'.$collection_name;
14
-        }
15
-        else
14
+        } else
16 15
         {
17 16
             $this->collection = $collection;
18 17
         }
@@ -26,8 +25,7 @@  discard block
 block discarded – undo
26 25
             if($filter instanceof \Data\Filter)
27 26
             {
28 27
                 $criteria = $filter->to_mongo_filter();
29
-            }
30
-            else
28
+            } else
31 29
             {
32 30
                 $criteria = $filter;
33 31
             }
@@ -44,8 +42,7 @@  discard block
 block discarded – undo
44 42
             if(is_array($filter))
45 43
             {
46 44
                 $criteria = $filter;
47
-            }
48
-            else
45
+            } else
49 46
             {
50 47
                 $criteria = $filter->to_mongo_filter();
51 48
             }
@@ -97,8 +94,7 @@  discard block
 block discarded – undo
97 94
             if(is_array($filter))
98 95
             {
99 96
                 $criteria = $filter;
100
-            }
101
-            else
97
+            } else
102 98
             {
103 99
                 $criteria = $filter->to_mongo_filter();
104 100
             }
@@ -123,8 +119,7 @@  discard block
 block discarded – undo
123 119
             if(is_array($filter))
124 120
             {
125 121
                 $criteria = $filter;
126
-            }
127
-            else
122
+            } else
128 123
             {
129 124
                 $criteria = $filter->to_mongo_filter();
130 125
             }
Please login to merge, or discard this patch.
Data/class.MongoDataSet.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,19 +40,16 @@  discard block
 block discarded – undo
40 40
         if(class_exists('MongoClient'))
41 41
         {
42 42
             $this->setupMongoClient($params);
43
-        }
44
-        else if(class_exists('\MongoDB\Driver\Manager'))
43
+        } else if(class_exists('\MongoDB\Driver\Manager'))
45 44
         {
46 45
             $this->setupMongoManager($params);
47
-        }
48
-        else
46
+        } else
49 47
         {
50 48
             require __DIR__.'/../libs/mongofill/src/functions.php';
51 49
             if(version_compare(PHP_VERSION, '5.3.0', '>='))
52 50
             {
53 51
                 spl_autoload_register('\Data\MongofillAutoload', true, true);
54
-            }
55
-            else
52
+            } else
56 53
             {
57 54
                 spl_autoload_register('\Data\MongofillAutoload');
58 55
             }
@@ -75,8 +72,7 @@  discard block
 block discarded – undo
75 72
         if($this->db !== null)
76 73
         {
77 74
             return new MongoDataTable($this->db->selectCollection($name));
78
-        }
79
-        else
75
+        } else
80 76
         {
81 77
             return new MongoDataTable($this->db_name, $name);
82 78
         }
@@ -87,8 +83,7 @@  discard block
 block discarded – undo
87 83
         if(isset($params['user']))
88 84
         {
89 85
             $this->client = new \MongoClient('mongodb://'.$params['host'].'/'.$params['db'], array('username'=>$params['user'], 'password'=>$params['pass']));
90
-        }
91
-        else
86
+        } else
92 87
         {
93 88
             $this->client = new \MongoClient('mongodb://'.$params['host'].'/'.$params['db']);
94 89
         }
@@ -100,8 +95,7 @@  discard block
 block discarded – undo
100 95
         if(isset($params['user']))
101 96
         {
102 97
             $this->manager = new \MongoDB\Driver\Manager('mongodb://'.$params['user'].':'.$params['pass'].'@'.$params['host'].'/'.$params['db']);
103
-        }
104
-        else
98
+        } else
105 99
         {
106 100
             $this->manager = new \MongoDB\Driver\Manager('mongodb://'.$params['host'].'/'.$params['db']);
107 101
         }
Please login to merge, or discard this patch.
Data/class.SQLDataTable.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,13 +38,11 @@  discard block
 block discarded – undo
38 38
                 if(isset($this->data[$array[$i][$key]][0]))
39 39
                 {
40 40
                     array_push($this->data[$array[$i][$key]], $array[$i]);
41
-                }
42
-                else
41
+                } else
43 42
                 {
44 43
                     $this->data[$array[$i][$key]] = array($array[$i]);
45 44
                 }
46
-            }
47
-            else
45
+            } else
48 46
             {
49 47
                 $this->data[$array[$i][$key]] = $array[$i];
50 48
             }
@@ -66,8 +64,7 @@  discard block
 block discarded – undo
66 64
         if($ret === false || !isset($ret[0]) || !isset($ret[0]['COUNT(*)']))
67 65
         {
68 66
              return false;
69
-        }
70
-        else
67
+        } else
71 68
         {
72 69
              return $ret[0]['COUNT(*)'];
73 70
         }
Please login to merge, or discard this patch.
Data/class.FilterClause.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
     function __construct($string=false)
11 11
     {
12
-        if($string !== false) $this->process_filter_string($string);
12
+        if($string !== false) {
13
+            $this->process_filter_string($string);
14
+        }
13 15
     }
14 16
 
15 17
     static function str_startswith($haystack, $needle)
@@ -126,8 +128,7 @@  discard block
 block discarded – undo
126 128
                 if($case)
127 129
                 {
128 130
                     return array($field=>array('$regex'=>new \MongoRegex('/'.$this->var2.'/i')));
129
-                }
130
-                else
131
+                } else
131 132
                 {
132 133
                     return array($field=>$this->var2);
133 134
                 }
Please login to merge, or discard this patch.
class.FlipPage.php 1 patch
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
19 19
 if(isset($GLOBALS['FLIPSIDE_SETTINGS_LOC']))
20 20
 {
21 21
     require_once($GLOBALS['FLIPSIDE_SETTINGS_LOC'].'/class.FlipsideSettings.php');
22
-}
23
-else
22
+} else
24 23
 {
25 24
     require_once('/var/www/secure_settings/class.FlipsideSettings.php');
26 25
 }
@@ -404,8 +403,7 @@  discard block
 block discarded – undo
404 403
             {
405 404
                 $this->addLink('Login', $this->loginUrl);
406 405
             }
407
-        }
408
-        else
406
+        } else
409 407
         {
410 408
             $this->add_links();
411 409
             $this->addLink('Logout', $this->logoutUrl);
@@ -423,7 +421,9 @@  discard block
 block discarded – undo
423 421
      */
424 422
     private function setupVars()
425 423
     {
426
-        if($this->minified !== null && $this->cdn !== null) return;
424
+        if($this->minified !== null && $this->cdn !== null) {
425
+            return;
426
+        }
427 427
         $this->minified = 'min';
428 428
         $this->cdn      = 'cdn';
429 429
         if(isset(FlipsideSettings::$global))
@@ -834,8 +834,7 @@  discard block
 block discarded – undo
834 834
         {
835 835
             $submenu['_'] = $url;
836 836
             $this->links[$name] = $submenu;
837
-        }
838
-        else
837
+        } else
839 838
         {
840 839
             $this->links[$name] = $url;
841 840
         }
Please login to merge, or discard this patch.
class.FlipSession.php 1 patch
Braces   +9 added lines, -13 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
         if(FlipSession::doesVarExist($name))
33 33
         {
34 34
             return $_SESSION[$name];
35
-        }
36
-        else
35
+        } else
37 36
         {
38 37
             return $default;
39 38
         }
@@ -59,13 +58,11 @@  discard block
 block discarded – undo
59 58
         if(isset($_SESSION['flipside_user']))
60 59
         {
61 60
             return true;
62
-        }
63
-        else if(isset($_SESSION['AuthMethod']) && isset($_SESSION['AuthData']))
61
+        } else if(isset($_SESSION['AuthMethod']) && isset($_SESSION['AuthData']))
64 62
         {
65 63
             $auth = AuthProvider::getInstance();
66 64
             return $auth->isLoggedIn($_SESSION['AuthData'], $_SESSION['AuthMethod']);
67
-        }
68
-        else
65
+        } else
69 66
         {
70 67
             return false;
71 68
         }
@@ -81,8 +78,7 @@  discard block
 block discarded – undo
81 78
         if(isset($_SESSION['flipside_user']))
82 79
         {
83 80
             return $_SESSION['flipside_user'];
84
-        }
85
-        else if(isset($_SESSION['AuthMethod']) && isset($_SESSION['AuthData']))
81
+        } else if(isset($_SESSION['AuthMethod']) && isset($_SESSION['AuthData']))
86 82
         {
87 83
             $auth = AuthProvider::getInstance();
88 84
             $user = $auth->getUser($_SESSION['AuthData'], $_SESSION['AuthMethod']);
@@ -91,8 +87,7 @@  discard block
 block discarded – undo
91 87
                 $_SESSION['flipside_user'] = $user;
92 88
             }
93 89
             return $user;
94
-        }
95
-        else
90
+        } else
96 91
         {
97 92
             return null;
98 93
         }
@@ -156,7 +151,9 @@  discard block
 block discarded – undo
156 151
             $pos = strpos($sessionData, "|", $offset);
157 152
             $len = $pos - $offset;
158 153
             $name = substr($sessionData, $offset, $len);
159
-            if($name === false) break;
154
+            if($name === false) {
155
+                break;
156
+            }
160 157
             $offset += $len+1;
161 158
             $data = @unserialize(substr($sessionData, $offset));
162 159
             $res[$name] = $data;
@@ -181,8 +178,7 @@  discard block
 block discarded – undo
181 178
             if($sessionData === false)
182 179
             {
183 180
                 array_push($res, array('sid' => $sessionId));
184
-            }
185
-            else
181
+            } else
186 182
             {
187 183
                 $tmp = FlipSession::unserializePhpSession($sessionData);
188 184
                 $tmp['sid' ] = $sessionId;
Please login to merge, or discard this patch.
class.WebPage.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@
 block discarded – undo
61 61
         if($browserName === 'IE' && $this->getBrowserMajorVer() <= 7)
62 62
         {
63 63
             header( 'Location: /badbrowser.php' ) ;
64
-        }
65
-        else if($browserName === 'Chrome' && $this->getBrowserMajorVer() >= 36)
64
+        } else if($browserName === 'Chrome' && $this->getBrowserMajorVer() >= 36)
66 65
         {
67 66
             $this->importSupport = true;
68 67
         }
Please login to merge, or discard this patch.