@@ -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 | |
@@ -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 |
@@ -56,17 +56,17 @@ |
||
| 56 | 56 | if (is_array($sval)) { |
| 57 | 57 | foreach ($sval as $_skey => $_sval) { |
| 58 | 58 | if (is_numeric($_skey)) { |
| 59 | - $data[] = $skey.'[] = '.(is_numeric($_sval) ? $_sval : (ctype_upper($_sval) ? $_sval : '"'.$_sval.'"')); |
|
| 59 | + $data[] = $skey . '[] = ' . (is_numeric($_sval) ? $_sval : (ctype_upper($_sval) ? $_sval : '"' . $_sval . '"')); |
|
| 60 | 60 | } else { |
| 61 | - $data[] = $skey.'['.$_skey.'] = '.(is_numeric($_sval) ? $_sval : (ctype_upper($_sval) ? $_sval : '"'.$_sval.'"')); |
|
| 61 | + $data[] = $skey . '[' . $_skey . '] = ' . (is_numeric($_sval) ? $_sval : (ctype_upper($_sval) ? $_sval : '"' . $_sval . '"')); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | } else { |
| 65 | - $data[] = $skey.' = '.(is_numeric($sval) ? $sval : (ctype_upper($sval) ? $sval : '"'.$sval.'"')); |
|
| 65 | + $data[] = $skey . ' = ' . (is_numeric($sval) ? $sval : (ctype_upper($sval) ? $sval : '"' . $sval . '"')); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | } else { |
| 69 | - $data[] = $key.' = '.(is_numeric($val) ? $val : (ctype_upper($val) ? $val : '"'.$val.'"')); |
|
| 69 | + $data[] = $key . ' = ' . (is_numeric($val) ? $val : (ctype_upper($val) ? $val : '"' . $val . '"')); |
|
| 70 | 70 | } |
| 71 | 71 | // empty line |
| 72 | 72 | $data[] = null; |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $entry = $record->getEntry($primaryKey); |
| 51 | 51 | if (in_array($entry->getType(), [IEntryType::TYPE_INTEGER, IEntryType::TYPE_FLOAT])) { |
| 52 | 52 | if (empty($entry->getData())) { |
| 53 | - $data = empty($records) ? 1 : intval(max(array_column($records, $primaryKey))) + 1 ; |
|
| 53 | + $data = empty($records) ? 1 : intval(max(array_column($records, $primaryKey))) + 1; |
|
| 54 | 54 | $entry->setData($data); |
| 55 | 55 | } |
| 56 | 56 | } |