Skip to content

Commit d710f5b

Browse files
author
Afonso Gloeden
committed
camelCase used in variables (PSR-1)
1 parent dcc0817 commit d710f5b

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

Database/Query/SybaseGrammar.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class SybaseGrammar extends Grammar {
1717
'&', '&=', '|', '|=', '^', '^=',
1818
];
1919

20-
protected $Builder;
20+
protected $builder;
2121

2222
public function getBuilder(){
23-
return $this->Builder;
23+
return $this->builder;
2424
}
2525

2626
/**
@@ -31,7 +31,7 @@ public function getBuilder(){
3131
*/
3232
public function compileSelect(Builder $query)
3333
{
34-
$this->Builder = $query;
34+
$this->builder = $query;
3535
$components = $this->compileComponents($query);
3636

3737
return $this->concatenate($components);

Database/SybaseConnection.php

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class SybaseConnection extends Connection {
1818
*
1919
* @var array
2020
*/
21-
private $without_quotes = [
21+
private $withoutQuotes = [
2222
'int',
2323
'numeric',
2424
'bigint',
@@ -115,7 +115,7 @@ private function compileForSelect(Builder $builder, $bindings) {
115115
array_push($arrTables, $join->table);
116116
}
117117
}
118-
$new_format = [];
118+
$newFormat = [];
119119
foreach ($arrTables as $tables) {
120120
preg_match("/(?:(?'table'.*)(?: as )(?'alias'.*))|(?'tables'.*)/", $tables, $alias);
121121
if (empty($alias['alias'])) {
@@ -155,21 +155,21 @@ private function compileForSelect(Builder $builder, $bindings) {
155155
for ($ind = 0; $ind < $wheresCount; $ind++) {
156156
if (isset($wheres[$ind]['value']) && isset($tipos[strtolower($wheres[$ind]['column'])])) {
157157
if (is_object($wheres[$ind]['value']) === false) {
158-
if (in_array(strtolower($tipos[strtolower($wheres[$ind]['column'])]), $this->without_quotes)) {
158+
if (in_array(strtolower($tipos[strtolower($wheres[$ind]['column'])]), $this->withoutQuotes)) {
159159
if (!is_null($bindings[$i])) {
160-
$new_binds[$i] = $bindings[$i] / 1;
160+
$newBinds[$i] = $bindings[$i] / 1;
161161
} else {
162-
$new_binds[$i] = null;
162+
$newBinds[$i] = null;
163163
}
164164
} else {
165-
$new_binds[$i] = (string) $bindings[$i];
165+
$newBinds[$i] = (string) $bindings[$i];
166166
}
167167
$i++;
168168
}
169169
}
170170
}
171171

172-
$new_format[$tables] = [];
172+
$newFormat[$tables] = [];
173173
}
174174

175175
$wheres = (array) $builder->wheres;
@@ -179,21 +179,21 @@ private function compileForSelect(Builder $builder, $bindings) {
179179
for ($ind = 0; $ind < $wheresCount; $ind++) {
180180
if (isset($wheres[$ind]['value'])) {
181181
if (is_object($wheres[$ind]['value']) === false) {
182-
if (in_array(strtolower($tipos[strtolower($wheres[$ind]['column'])]), $this->without_quotes)) {
182+
if (in_array(strtolower($tipos[strtolower($wheres[$ind]['column'])]), $this->withoutQuotes)) {
183183
if (!is_null($bindings[$i])) {
184-
$new_binds[$i] = $bindings[$i] / 1;
184+
$newBinds[$i] = $bindings[$i] / 1;
185185
} else {
186-
$new_binds[$i] = null;
186+
$newBinds[$i] = null;
187187
}
188188
} else {
189-
$new_binds[$i] = (string) $bindings[$i];
189+
$newBinds[$i] = (string) $bindings[$i];
190190
}
191191
$i++;
192192
}
193193
}
194194
}
195195

196-
return $new_binds;
196+
return $newBinds;
197197
}
198198

199199
private function queryStringForSelect($tables)
@@ -257,7 +257,7 @@ private function queryStringForSelect($tables)
257257
*
258258
* @param string $query
259259
* @param array $bindings
260-
* @return mixed $new_binds
260+
* @return mixed $newBinds
261261
*/
262262
private function compileBindings($query, $bindings)
263263
{
@@ -266,7 +266,7 @@ private function compileBindings($query, $bindings)
266266
}
267267

268268
$bindings = $this->prepareBindings($bindings);
269-
$new_format = [];
269+
$newFormat = [];
270270

271271
switch (explode(' ', $query)[0]) {
272272
case "select":
@@ -300,9 +300,9 @@ private function compileBindings($query, $bindings)
300300
}
301301

302302
unset($matches);
303-
unset($query_type);
303+
unset($queryType);
304304
preg_match_all("/\[([^\]]*)\]/", $desQuery['attributes'], $arrQuery);
305-
preg_match_all("/\[([^\]]*)\]/", str_replace( "].[].[", '..', $desQuery['tables']), $arrTables);
305+
preg_match_all("/\[([^\]]*)\]/", str_replace("].[].[", '..', $desQuery['tables']), $arrTables);
306306

307307
$arrQuery = $arrQuery[1];
308308
$arrTables = $arrTables[1];
@@ -322,37 +322,37 @@ private function compileBindings($query, $bindings)
322322
if ($numTables > 1) {
323323
$table = $campos;
324324
}
325-
if (!array_key_exists($table, $new_format)) {
325+
if (!array_key_exists($table, $newFormat)) {
326326
$queryRes = $this->getPdo()->query($this->queryStringForCompileBindings($table));
327327
$types[$table] = $queryRes->fetchAll(\PDO::FETCH_ASSOC);
328328
for ($k = 0; $k < count($types[$table]); $k++) {
329329
$types[$table][$types[$table][$k]['name']] = $types[$table][$k];
330330
unset($types[$table][$k]);
331331
}
332-
$new_format[$table] = [];
332+
$newFormat[$table] = [];
333333
}
334334
}
335335

336336
if (!$itsTable) {
337337
if (count($bindings) > $ind) {
338-
array_push($new_format[$table], ['campo' => $campos, 'binding' => $ind]);
339-
if (in_array(strtolower($types[$table][$campos]['type']), $this->without_quotes)) {
338+
array_push($newFormat[$table], ['campo' => $campos, 'binding' => $ind]);
339+
if (in_array(strtolower($types[$table][$campos]['type']), $this->withoutQuotes)) {
340340
if (!is_null($bindings[$ind])) {
341-
$new_binds[$ind] = $bindings[$ind] / 1;
341+
$newBinds[$ind] = $bindings[$ind] / 1;
342342
} else {
343-
$new_binds[$ind] = null;
343+
$newBinds[$ind] = null;
344344
}
345345
} else {
346-
$new_binds[$ind] = (string) $bindings[$ind];
346+
$newBinds[$ind] = (string) $bindings[$ind];
347347
}
348348
} else {
349-
array_push($new_format[$table], ['campo' => $campos]);
349+
array_push($newFormat[$table], ['campo' => $campos]);
350350
}
351351
$ind++;
352352
}
353353
}
354354

355-
return $new_binds;
355+
return $newBinds;
356356
}
357357

358358
private function queryStringForCompileBindings($table)
@@ -459,19 +459,19 @@ public function compileOffset($offset, $query, $bindings = array(), $me)
459459
$queryString = $this->queryStringForPrimaries($from);
460460
$primaries = $this->getPdo()->query($queryString)->fetchAll($me->getFetchMode());
461461
foreach ($primaries as $primary) {
462-
$new_arr[] = $primary->primary_key . '+0 AS ' . $primary->primary_key;
463-
$where_arr[] = "#tmpPaginate." . $primary->primary_key . ' = #tmpTable.' . $primary->primary_key;
462+
$newArr[] = $primary->primary_key . '+0 AS ' . $primary->primary_key;
463+
$whereArr[] = "#tmpPaginate." . $primary->primary_key . ' = #tmpTable.' . $primary->primary_key;
464464
}
465-
$res_primaries = implode(', ', $new_arr);
466-
$where_primaries = implode(' AND ', $where_arr);
465+
$resPrimaries = implode(', ', $newArr);
466+
$wherePrimaries = implode(' AND ', $whereArr);
467467
} else {
468-
$res_primaries = $identity->column . '+0 AS ' . $identity->column;
469-
$where_primaries = "#tmpPaginate." . $identity->column . ' = #tmpTable.' . $identity->column;
468+
$resPrimaries = $identity->column . '+0 AS ' . $identity->column;
469+
$wherePrimaries = "#tmpPaginate." . $identity->column . ' = #tmpTable.' . $identity->column;
470470
// Offset operation
471471
$this->getPdo()->query(str_replace(" from ", " into #tmpPaginate from ", $this->compileNewQuery($query, $bindings)));
472472
$this->getPdo()->query("
473473
SELECT
474-
" . $res_primaries . ",
474+
" . $resPrimaries . ",
475475
idTmp=identity(18)
476476
INTO
477477
#tmpTable
@@ -486,7 +486,7 @@ public function compileOffset($offset, $query, $bindings = array(), $me)
486486
INNER JOIN
487487
#tmpPaginate
488488
ON
489-
" . $where_primaries . "
489+
" . $wherePrimaries . "
490490
WHERE
491491
#tmpTable.idTmp BETWEEN " . ($offset + 1) . " AND
492492
" . ($offset + $limit) . "

0 commit comments

Comments
 (0)