@@ -117,7 +117,7 @@ public function deleteTicket($ticketId)
117117 */
118118 private function scopeTicketId ($ ticketId )
119119 {
120- return $ this ->prefix . '. ' . $ ticketId ;
120+ return $ this ->prefix . '. ' . $ ticketId ;
121121 }
122122
123123
@@ -130,9 +130,9 @@ private function initTableVersionTable()
130130 $ this ->tableVersions = [];
131131
132132 try {
133- $ fetchTableVersion = $ this ->pdo ->query ('SELECT _name, _version FROM ' . $ this ->prefix . '_tableVersion ' );
133+ $ fetchTableVersion = $ this ->pdo ->query ('SELECT _name, _version FROM ' . $ this ->prefix . '_tableVersion ' );
134134 } catch (PDOException $ e ) {
135- $ this ->pdo ->exec ('CREATE TABLE ' . $ this ->prefix .
135+ $ this ->pdo ->exec ('CREATE TABLE ' . $ this ->prefix .
136136 '_tableVersion (_name VARCHAR(30) NOT NULL UNIQUE, _version INTEGER NOT NULL) ' );
137137 return ;
138138 }
@@ -153,11 +153,11 @@ private function initKVTable()
153153 return ;
154154 }
155155
156- $ query = 'CREATE TABLE ' . $ this ->prefix .
156+ $ query = 'CREATE TABLE ' . $ this ->prefix .
157157 '_kvstore (_key VARCHAR(50) NOT NULL, _value TEXT NOT NULL, _expire TIMESTAMP, PRIMARY KEY (_key)) ' ;
158158 $ this ->pdo ->exec ($ query );
159159
160- $ query = 'CREATE INDEX ' . $ this ->prefix . '_kvstore_expire ON ' . $ this ->prefix . '_kvstore (_expire) ' ;
160+ $ query = 'CREATE INDEX ' . $ this ->prefix . '_kvstore_expire ON ' . $ this ->prefix . '_kvstore (_expire) ' ;
161161 $ this ->pdo ->exec ($ query );
162162
163163 $ this ->setTableVersion ('kvstore ' , 1 );
@@ -191,7 +191,7 @@ private function setTableVersion($name, $version)
191191 Assert::integer ($ version );
192192
193193 $ this ->insertOrUpdate (
194- $ this ->prefix . '_tableVersion ' ,
194+ $ this ->prefix . '_tableVersion ' ,
195195 ['_name ' ],
196196 [
197197 '_name ' => $ name ,
@@ -212,24 +212,24 @@ private function insertOrUpdate($table, array $keys, array $data)
212212 {
213213 Assert::string ($ table );
214214
215- $ colNames = '( ' . implode (', ' , array_keys ($ data )). ') ' ;
216- $ values = 'VALUES(: ' . implode (', : ' , array_keys ($ data )). ') ' ;
215+ $ colNames = '( ' . implode (', ' , array_keys ($ data )) . ') ' ;
216+ $ values = 'VALUES(: ' . implode (', : ' , array_keys ($ data )) . ') ' ;
217217
218218 switch ($ this ->driver ) {
219219 case 'mysql ' :
220- $ query = 'REPLACE INTO ' . $ table. ' ' . $ colNames. ' ' . $ values ;
220+ $ query = 'REPLACE INTO ' . $ table . ' ' . $ colNames . ' ' . $ values ;
221221 $ query = $ this ->pdo ->prepare ($ query );
222222 $ query ->execute ($ data );
223223 return ;
224224 case 'sqlite ' :
225- $ query = 'INSERT OR REPLACE INTO ' . $ table. ' ' . $ colNames. ' ' . $ values ;
225+ $ query = 'INSERT OR REPLACE INTO ' . $ table . ' ' . $ colNames . ' ' . $ values ;
226226 $ query = $ this ->pdo ->prepare ($ query );
227227 $ query ->execute ($ data );
228228 return ;
229229 default :
230230 /* Default implementation. Try INSERT, and UPDATE if that fails. */
231231
232- $ insertQuery = 'INSERT INTO ' . $ table. ' ' . $ colNames. ' ' . $ values ;
232+ $ insertQuery = 'INSERT INTO ' . $ table . ' ' . $ colNames . ' ' . $ values ;
233233 /** @var \PDOStatement|false $insertQuery */
234234 $ insertQuery = $ this ->pdo ->prepare ($ insertQuery );
235235
@@ -260,7 +260,7 @@ private function insertOrUpdateFallback($table, array $keys, array $data, PDOSta
260260 case '23505 ' : /* PostgreSQL */
261261 break ;
262262 default :
263- Logger::error ('casserver: Error while saving data: ' . $ e ->getMessage ());
263+ Logger::error ('casserver: Error while saving data: ' . $ e ->getMessage ());
264264 throw $ e ;
265265 }
266266 }
@@ -269,7 +269,7 @@ private function insertOrUpdateFallback($table, array $keys, array $data, PDOSta
269269 $ condCols = [];
270270
271271 foreach ($ data as $ col => $ value ) {
272- $ tmp = $ col. ' = : ' . $ col ;
272+ $ tmp = $ col . ' = : ' . $ col ;
273273
274274 if (in_array ($ col , $ keys , true )) {
275275 $ condCols [] = $ tmp ;
@@ -278,7 +278,7 @@ private function insertOrUpdateFallback($table, array $keys, array $data, PDOSta
278278 }
279279 }
280280
281- $ updateQuery = 'UPDATE ' . $ table. ' SET ' . implode (', ' , $ updateCols ). ' WHERE ' . implode (' AND ' , $ condCols );
281+ $ updateQuery = 'UPDATE ' . $ table . ' SET ' . implode (', ' , $ updateCols ) . ' WHERE ' . implode (' AND ' , $ condCols );
282282 $ updateQuery = $ this ->pdo ->prepare ($ updateQuery );
283283 $ updateQuery ->execute ($ data );
284284 }
@@ -289,7 +289,7 @@ private function insertOrUpdateFallback($table, array $keys, array $data, PDOSta
289289 */
290290 private function cleanKVStore ()
291291 {
292- $ query = 'DELETE FROM ' . $ this ->prefix . '_kvstore WHERE _expire < :now ' ;
292+ $ query = 'DELETE FROM ' . $ this ->prefix . '_kvstore WHERE _expire < :now ' ;
293293 $ params = ['now ' => gmdate ('Y-m-d H:i:s ' )];
294294
295295 $ query = $ this ->pdo ->prepare ($ query );
@@ -309,7 +309,7 @@ private function get($key)
309309 $ key = sha1 ($ key );
310310 }
311311
312- $ query = 'SELECT _value FROM ' . $ this ->prefix .
312+ $ query = 'SELECT _value FROM ' . $ this ->prefix .
313313 '_kvstore WHERE _key = :key AND (_expire IS NULL OR _expire > :now) ' ;
314314 $ params = ['key ' => $ key , 'now ' => gmdate ('Y-m-d H:i:s ' )];
315315
@@ -369,7 +369,7 @@ private function set($key, $value, $expire = null)
369369 '_expire ' => $ expire ,
370370 ];
371371
372- $ this ->insertOrUpdate ($ this ->prefix . '_kvstore ' , ['_key ' ], $ data );
372+ $ this ->insertOrUpdate ($ this ->prefix . '_kvstore ' , ['_key ' ], $ data );
373373 }
374374
375375
@@ -390,7 +390,7 @@ private function delete($key)
390390
391391 ];
392392
393- $ query = 'DELETE FROM ' . $ this ->prefix . '_kvstore WHERE _key=:_key ' ;
393+ $ query = 'DELETE FROM ' . $ this ->prefix . '_kvstore WHERE _key=:_key ' ;
394394 $ query = $ this ->pdo ->prepare ($ query );
395395 $ query ->execute ($ data );
396396 }
0 commit comments