@@ -17,19 +17,19 @@ |
||
17 | 17 | const ORDER_ASC = 'ASC'; |
18 | 18 | const ORDER_DESC = 'DESC'; |
19 | 19 | |
20 | - const OPERATION_NULL = 'nul'; // is null |
|
21 | - const OPERATION_NNULL = 'nnul'; // is not null |
|
22 | - const OPERATION_EQ = 'eq'; // = |
|
23 | - const OPERATION_NEQ = 'neq'; // != |
|
24 | - const OPERATION_GT = 'gt'; // > |
|
25 | - const OPERATION_GTE = 'gte'; // >= |
|
26 | - const OPERATION_LT = 'lt'; // < |
|
27 | - const OPERATION_LTE = 'lte'; // <= |
|
28 | - const OPERATION_LIKE = 'like'; // like... |
|
20 | + const OPERATION_NULL = 'nul'; // is null |
|
21 | + const OPERATION_NNULL = 'nnul'; // is not null |
|
22 | + const OPERATION_EQ = 'eq'; // = |
|
23 | + const OPERATION_NEQ = 'neq'; // != |
|
24 | + const OPERATION_GT = 'gt'; // > |
|
25 | + const OPERATION_GTE = 'gte'; // >= |
|
26 | + const OPERATION_LT = 'lt'; // < |
|
27 | + const OPERATION_LTE = 'lte'; // <= |
|
28 | + const OPERATION_LIKE = 'like'; // like... |
|
29 | 29 | const OPERATION_NLIKE = 'nlike'; // not like |
30 | - const OPERATION_REXP = 'rexp'; // regex |
|
31 | - const OPERATION_IN = 'in'; // in () |
|
32 | - const OPERATION_NIN = 'nin'; // not in () |
|
30 | + const OPERATION_REXP = 'rexp'; // regex |
|
31 | + const OPERATION_IN = 'in'; // in () |
|
32 | + const OPERATION_NIN = 'nin'; // not in () |
|
33 | 33 | |
34 | 34 | const AGGREGATE_AVG = 'AVG'; |
35 | 35 | const AGGREGATE_COUNT = 'COUNT'; |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $connection->setAttribute(PDO::ATTR_PERSISTENT, true); |
38 | 38 | } |
39 | 39 | |
40 | - foreach ($this->attributes as $key => $value){ |
|
40 | + foreach ($this->attributes as $key => $value) { |
|
41 | 41 | $connection->setAttribute($key, $value); |
42 | 42 | } |
43 | 43 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $connection->setAttribute(PDO::ATTR_PERSISTENT, true); |
38 | 38 | } |
39 | 39 | |
40 | - foreach ($this->attributes as $key => $value){ |
|
40 | + foreach ($this->attributes as $key => $value) { |
|
41 | 41 | $connection->setAttribute($key, $value); |
42 | 42 | } |
43 | 43 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $connection->setAttribute(PDO::ATTR_PERSISTENT, true); |
38 | 38 | } |
39 | 39 | |
40 | - foreach ($this->attributes as $key => $value){ |
|
40 | + foreach ($this->attributes as $key => $value) { |
|
41 | 41 | $connection->setAttribute($key, $value); |
42 | 42 | } |
43 | 43 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $connection->setAttribute(PDO::ATTR_PERSISTENT, true); |
38 | 38 | } |
39 | 39 | |
40 | - foreach ($this->attributes as $key => $value){ |
|
40 | + foreach ($this->attributes as $key => $value) { |
|
41 | 41 | $connection->setAttribute($key, $value); |
42 | 42 | } |
43 | 43 |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | */ |
408 | 408 | protected function correctTable(string $table): string |
409 | 409 | { |
410 | - return empty($table) ? $this->basicRecord->getMapper()->getAlias() : $table ; |
|
410 | + return empty($table) ? $this->basicRecord->getMapper()->getAlias() : $table; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | /** |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | */ |
419 | 419 | protected function correctColumn(string $table, string $column) |
420 | 420 | { |
421 | - $record = !empty($table) ? $this->recordLookup($table)->getRecord() : $this->basicRecord ; |
|
421 | + $record = !empty($table) ? $this->recordLookup($table)->getRecord() : $this->basicRecord; |
|
422 | 422 | if (empty($record)) { |
423 | 423 | // @codeCoverageIgnoreStart |
424 | 424 | throw new MapperException(sprintf('Unknown relation table *%s*', $table)); |
@@ -42,14 +42,14 @@ |
||
42 | 42 | // through relations |
43 | 43 | foreach ($toCompare as $relationKey => $compareValue) { |
44 | 44 | foreach ($this->records as $positionKey => $knownRecord) { |
45 | - if ( !isset($toProcess[$positionKey]) ) { // not twice |
|
45 | + if (!isset($toProcess[$positionKey])) { // not twice |
|
46 | 46 | continue; |
47 | 47 | } |
48 | - if ( !$knownRecord->offsetExists($relationKey) ) { // unknown relation key in record is not allowed into compare |
|
48 | + if (!$knownRecord->offsetExists($relationKey)) { // unknown relation key in record is not allowed into compare |
|
49 | 49 | unset($toProcess[$positionKey]); |
50 | 50 | continue; |
51 | 51 | } |
52 | - if ( strval($knownRecord->offsetGet($relationKey)) != strval($compareValue) ) { |
|
52 | + if (strval($knownRecord->offsetGet($relationKey)) != strval($compareValue)) { |
|
53 | 53 | unset($toProcess[$positionKey]); |
54 | 54 | continue; |
55 | 55 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | foreach ($this->getPrimaryKeys() as $key) { |
76 | 76 | $toComplete[] = $record->offsetGet($key); |
77 | 77 | } |
78 | - return (count(array_filter($toComplete))) ? implode('_', $toComplete) : null ; |
|
78 | + return (count(array_filter($toComplete))) ? implode('_', $toComplete) : null; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | $workArray[] = $value; |
67 | 67 | } |
68 | 68 | |
69 | - $returnString = ''; # Initialize return string |
|
70 | - $arraySize = count($workArray); # Get size of array |
|
69 | + $returnString = ''; # Initialize return string |
|
70 | + $arraySize = count($workArray); # Get size of array |
|
71 | 71 | |
72 | - for ($i=0; $i<$arraySize; $i++) { |
|
72 | + for ($i = 0; $i < $arraySize; $i++) { |
|
73 | 73 | # Nested array, process nest item |
74 | 74 | if (is_array($workArray[$i])) { |
75 | 75 | $returnString .= $this->str_putcsv($workArray[$i], $delimiter, $enclosure, $terminator); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | switch (gettype($workArray[$i])) { |
78 | 78 | # Manually set some strings |
79 | 79 | case "NULL": $_spFormat = ''; break; |
80 | - case "boolean": $_spFormat = (true == $workArray[$i]) ? 'true': 'false'; break; |
|
80 | + case "boolean": $_spFormat = (true == $workArray[$i]) ? 'true' : 'false'; break; |
|
81 | 81 | # Make sure sprintf has a good datatype to work with |
82 | 82 | case "integer": $_spFormat = '%i'; break; |
83 | 83 | case "double": $_spFormat = '%0.2f'; break; |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | case "resource": |
88 | 88 | default: $_spFormat = ''; break; |
89 | 89 | } |
90 | - $returnString .= sprintf('%2$s'.$_spFormat.'%2$s', $workArray[$i], $enclosure); |
|
91 | - $returnString .= ($i < ($arraySize-1)) ? $delimiter : $terminator; |
|
90 | + $returnString .= sprintf('%2$s' . $_spFormat . '%2$s', $workArray[$i], $enclosure); |
|
91 | + $returnString .= ($i < ($arraySize - 1)) ? $delimiter : $terminator; |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | # Done the workload, return the output information |