@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | static::$namingUsed = true; |
| 126 | 126 | $reflection = self::getReflection(); |
| 127 | 127 | |
| 128 | - $tableName = preg_replace_callback('/%([a-z]+)(\[(-?\d+)(\*)?\])?%/', function ($match) use ($reflection) { |
|
| 128 | + $tableName = preg_replace_callback('/%([a-z]+)(\[(-?\d+)(\*)?\])?%/', function($match) use ($reflection) { |
|
| 129 | 129 | switch ($match[1]) { |
| 130 | 130 | case 'short': |
| 131 | 131 | $words = [$reflection->getShortName()]; |
@@ -151,8 +151,7 @@ discard block |
||
| 151 | 151 | $from = $match[3][0] === '-' ? count($words) - substr($match[3], 1) : $match[3]; |
| 152 | 152 | if (isset($words[$from])) { |
| 153 | 153 | return !isset($match[4]) ? |
| 154 | - $words[$from] : |
|
| 155 | - implode('_', array_slice($words, $from)); |
|
| 154 | + $words[$from] : implode('_', array_slice($words, $from)); |
|
| 156 | 155 | } |
| 157 | 156 | return ''; |
| 158 | 157 | }, static::getTableNameTemplate()); |
@@ -399,7 +398,7 @@ discard block |
||
| 399 | 398 | $words = explode('_', preg_replace( |
| 400 | 399 | '/([a-z0-9])([A-Z])/', |
| 401 | 400 | '$1_$2', |
| 402 | - preg_replace_callback('/([a-z0-9])?([A-Z]+)([A-Z][a-z])/', function ($d) { |
|
| 401 | + preg_replace_callback('/([a-z0-9])?([A-Z]+)([A-Z][a-z])/', function($d) { |
|
| 403 | 402 | return ($d[1] ? $d[1] . '_' : '') . $d[2] . '_' . $d[3]; |
| 404 | 403 | }, $name) |
| 405 | 404 | )); |
@@ -673,7 +672,7 @@ discard block |
||
| 673 | 672 | if (empty($associations)) { |
| 674 | 673 | $cols[] = $this->entityManager->escapeIdentifier($fkCol); |
| 675 | 674 | } |
| 676 | - $value = $entity->__get($hisVar); |
|
| 675 | + $value = $entity->__get($hisVar); |
|
| 677 | 676 | |
| 678 | 677 | if ($value === null) { |
| 679 | 678 | throw new IncompletePrimaryKey('Key incomplete to save foreign key'); |
@@ -719,7 +718,7 @@ discard block |
||
| 719 | 718 | $where = []; |
| 720 | 719 | |
| 721 | 720 | foreach ($myRelDef[self::OPT_RELATION_REFERENCE] as $myVar => $fkCol) { |
| 722 | - $value = $this->__get($myVar); |
|
| 721 | + $value = $this->__get($myVar); |
|
| 723 | 722 | |
| 724 | 723 | if ($value === null) { |
| 725 | 724 | throw new IncompletePrimaryKey('Key incomplete to save foreign key'); |
@@ -736,13 +735,13 @@ discard block |
||
| 736 | 735 | |
| 737 | 736 | $condition = []; |
| 738 | 737 | foreach ($oppRelDef[self::OPT_RELATION_REFERENCE] as $hisVar => $fkCol) { |
| 739 | - $value = $entity->__get($hisVar); |
|
| 738 | + $value = $entity->__get($hisVar); |
|
| 740 | 739 | |
| 741 | 740 | if ($value === null) { |
| 742 | 741 | throw new IncompletePrimaryKey('Key incomplete to save foreign key'); |
| 743 | 742 | } |
| 744 | 743 | |
| 745 | - $condition[] = $this->entityManager->escapeIdentifier($fkCol) .' = ' . |
|
| 744 | + $condition[] = $this->entityManager->escapeIdentifier($fkCol) . ' = ' . |
|
| 746 | 745 | $this->entityManager->escapeValue($value); |
| 747 | 746 | } |
| 748 | 747 | $where[] = implode(' AND ', $condition); |
@@ -897,8 +896,7 @@ discard block |
||
| 897 | 896 | |
| 898 | 897 | $foreignKey = []; |
| 899 | 898 | $reference = !isset($myRelDef[self::OPT_RELATION_TABLE]) ? |
| 900 | - array_flip($oppRelDef[self::OPT_RELATION_REFERENCE]) : |
|
| 901 | - $myRelDef[self::OPT_RELATION_REFERENCE]; |
|
| 899 | + array_flip($oppRelDef[self::OPT_RELATION_REFERENCE]) : $myRelDef[self::OPT_RELATION_REFERENCE]; |
|
| 902 | 900 | |
| 903 | 901 | foreach ($reference as $var => $fkCol) { |
| 904 | 902 | $value = $this->__get($var); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | '((?<class>[A-Za-z_][A-Za-z0-9_\\\\]*)::|(?<alias>[A-Za-z_][A-Za-z0-9_]+)\.)?' . |
| 112 | 112 | '(?<column>[A-Za-z_][A-Za-z0-9_]*)' . |
| 113 | 113 | '(?<a>$| |,|\))/', |
| 114 | - function ($match) { |
|
| 114 | + function($match) { |
|
| 115 | 115 | if ($match['class']) { |
| 116 | 116 | if (!isset($this->classMapping['byClass'][$match['class']])) { |
| 117 | 117 | throw new NotJoined("Class " . $match['class'] . " not joined"); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | return null; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - $data = $result->fetch(\PDO::FETCH_ASSOC); |
|
| 206 | + $data = $result->fetch(\PDO::FETCH_ASSOC); |
|
| 207 | 207 | |
| 208 | 208 | if (!$data) { |
| 209 | 209 | return null; |
@@ -230,11 +230,11 @@ discard block |
||
| 230 | 230 | { |
| 231 | 231 | $data = $entity->getData(); |
| 232 | 232 | |
| 233 | - $cols = array_map(function ($key) { |
|
| 233 | + $cols = array_map(function($key) { |
|
| 234 | 234 | return $this->escapeIdentifier($key); |
| 235 | 235 | }, array_keys($data)); |
| 236 | 236 | |
| 237 | - $values = array_map(function ($value) use ($entity) { |
|
| 237 | + $values = array_map(function($value) use ($entity) { |
|
| 238 | 238 | return $this->escapeValue($value); |
| 239 | 239 | }, array_values($data)); |
| 240 | 240 | |
@@ -440,11 +440,11 @@ discard block |
||
| 440 | 440 | break; |
| 441 | 441 | |
| 442 | 442 | case 'integer': |
| 443 | - return (string)$value; |
|
| 443 | + return (string) $value; |
|
| 444 | 444 | break; |
| 445 | 445 | |
| 446 | 446 | case 'double': |
| 447 | - return (string)$value; |
|
| 447 | + return (string) $value; |
|
| 448 | 448 | break; |
| 449 | 449 | |
| 450 | 450 | case 'boolean': |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } elseif ($empty) { |
| 226 | 226 | $this->joins[] = $join; |
| 227 | 227 | } else { |
| 228 | - return new Parenthesis(function (ParenthesisInterface $parenthesis) use ($join) { |
|
| 228 | + return new Parenthesis(function(ParenthesisInterface $parenthesis) use ($join) { |
|
| 229 | 229 | $join .= ' ON ' . $parenthesis->getExpression(); |
| 230 | 230 | $this->joins[] = $join; |
| 231 | 231 | return $this; |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | /** {@inheritdoc} */ |
| 309 | 309 | public function limit($limit) |
| 310 | 310 | { |
| 311 | - $this->limit = (int)$limit; |
|
| 311 | + $this->limit = (int) $limit; |
|
| 312 | 312 | |
| 313 | 313 | return $this; |
| 314 | 314 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | /** {@inheritdoc} */ |
| 317 | 317 | public function offset($offset) |
| 318 | 318 | { |
| 319 | - $this->offset = (int)$offset; |
|
| 319 | + $this->offset = (int) $offset; |
|
| 320 | 320 | |
| 321 | 321 | return $this; |
| 322 | 322 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | /** {@inheritdoc} */ |
| 86 | 86 | public function andParenthesis() |
| 87 | 87 | { |
| 88 | - $parenthesis = new Parenthesis(function (ParenthesisInterface $parenthesis) { |
|
| 88 | + $parenthesis = new Parenthesis(function(ParenthesisInterface $parenthesis) { |
|
| 89 | 89 | $this->where[] = (!empty($this->where) ? 'AND ' : '') . $parenthesis->getExpression(); |
| 90 | 90 | |
| 91 | 91 | return $this; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | /** {@inheritdoc} */ |
| 98 | 98 | public function orParenthesis() |
| 99 | 99 | { |
| 100 | - $parenthesis = new Parenthesis(function (ParenthesisInterface $parenthesis) { |
|
| 100 | + $parenthesis = new Parenthesis(function(ParenthesisInterface $parenthesis) { |
|
| 101 | 101 | $this->where[] = (!empty($this->where) ? 'OR ' : '') . $parenthesis->getExpression(); |
| 102 | 102 | |
| 103 | 103 | return $this; |