@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function boolean($name, $default = null) |
| 155 | 155 | { |
| 156 | - return $this->add($name, TypeInterface::BOOLEAN, $default !== null ? (bool)$default : null); |
|
| 156 | + return $this->add($name, TypeInterface::BOOLEAN, $default !== null ? (bool) $default : null); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | public function field($name) |
| 606 | 606 | { |
| 607 | 607 | if (!isset($this->fields[$name])) { |
| 608 | - throw new \RuntimeException('Field ' . $name . ' not found'); |
|
| 608 | + throw new \RuntimeException('Field '.$name.' not found'); |
|
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | $this->current = $name; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $relation = parent::relation($relationName); |
| 53 | 53 | |
| 54 | 54 | if ($this->isDiscriminatedMapper() && $relation['type'] == Relation::BY_INHERITANCE) { |
| 55 | - throw new \RuntimeException('Relation type not allowed from relation "' . $relationName . '" in ' . $this->getEntityClass()); |
|
| 55 | + throw new \RuntimeException('Relation type not allowed from relation "'.$relationName.'" in '.$this->getEntityClass()); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | return $relation; |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $discriminatorField = $this->metadata()->attributes[$this->discriminatorColumn]['field']; |
| 149 | 149 | |
| 150 | 150 | if (empty($data[$discriminatorField])) { |
| 151 | - throw new \Exception('Discriminator field "' . $discriminatorField . '" not found'); |
|
| 151 | + throw new \Exception('Discriminator field "'.$discriminatorField.'" not found'); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | return $data[$discriminatorField]; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | public function getDiscriminatorType($discriminatorValue) |
| 167 | 167 | { |
| 168 | 168 | if (empty($this->discriminatorMap[$discriminatorValue])) { |
| 169 | - throw new \Exception('Unknown discriminator type "' . $discriminatorValue . '"'); |
|
| 169 | + throw new \Exception('Unknown discriminator type "'.$discriminatorValue.'"'); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | return $this->discriminatorMap[$discriminatorValue]; |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | $attributePath = $attribute; |
| 843 | 843 | $path = null; |
| 844 | 844 | } else { |
| 845 | - $attributePath = $embeddedMeta['path'] . '.' . $attribute; |
|
| 845 | + $attributePath = $embeddedMeta['path'].'.'.$attribute; |
|
| 846 | 846 | $path = $embeddedMeta['path']; |
| 847 | 847 | } |
| 848 | 848 | |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | : $this->connection, |
| 901 | 901 | 'table' => isset($sequence['table']) |
| 902 | 902 | ? $sequence['table'] |
| 903 | - : $this->table . '_seq', |
|
| 903 | + : $this->table.'_seq', |
|
| 904 | 904 | 'column' => isset($sequence['column']) |
| 905 | 905 | ? $sequence['column'] |
| 906 | 906 | : 'id', |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | $this->remove($attribute); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $this->criteria[$filter] = $value; |
|
| 91 | + $this->criteria[$filter] = $value; |
|
| 92 | 92 | $this->inputs[$attribute][] = $filter; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | foreach ($data as $attribute => $value) { |
| 29 | - $method = 'set' . ucfirst($attribute); |
|
| 29 | + $method = 'set'.ucfirst($attribute); |
|
| 30 | 30 | $exists = property_exists($this, $attribute); |
| 31 | 31 | |
| 32 | 32 | if ($exists && $this->$attribute instanceof ImportableInterface && !$value instanceof ImportableInterface) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | return ''; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - return 'namespace ' . $namespace . ';'; |
|
| 41 | + return 'namespace '.$namespace.';'; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $out = ''; |
| 55 | 55 | |
| 56 | 56 | foreach ($names as $property) { |
| 57 | - $out .= $visibility.' $' . $property . ';'.$this->eol; |
|
| 57 | + $out .= $visibility.' $'.$property.';'.$this->eol; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return $out; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function simpleConstructor($properties) |
| 71 | 71 | { |
| 72 | - $parameters = implode(', ', array_map(function ($p) { return '$'.$p; }, $properties)); |
|
| 72 | + $parameters = implode(', ', array_map(function($p) { return '$'.$p; }, $properties)); |
|
| 73 | 73 | $content = ''; |
| 74 | 74 | |
| 75 | 75 | foreach ($properties as $property) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $content .= $this->eol; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - $content .= '$this->' . $property . ' = $' . $property . ';'; |
|
| 80 | + $content .= '$this->'.$property.' = $'.$property.';'; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | $spaces = str_repeat($this->tab, $tabs); |
| 103 | 103 | |
| 104 | - return $spaces . str_replace($this->eol, $this->eol.$spaces, $code); |
|
| 104 | + return $spaces.str_replace($this->eol, $this->eol.$spaces, $code); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | * |
| 160 | 160 | * @return string |
| 161 | 161 | */ |
| 162 | - public function switch($varName, array $cases, $default = null) |
|
| 162 | + public function switch ($varName, array $cases, $default = null) |
|
| 163 | 163 | { |
| 164 | 164 | $code = 'switch ('.$varName.') {'.$this->eol; |
| 165 | 165 | |
@@ -724,13 +724,13 @@ |
||
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 | $replacements = array( |
| 727 | - '<description>' => ucfirst($type).' '.$variableName, |
|
| 728 | - '<methodTypeHint>' => $methodTypeHint, |
|
| 729 | - '<variableType>' => $variableType, |
|
| 730 | - '<variableName>' => $variableName, |
|
| 731 | - '<methodName>' => $methodName, |
|
| 732 | - '<fieldName>' => $fieldName, |
|
| 733 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '' |
|
| 727 | + '<description>' => ucfirst($type).' '.$variableName, |
|
| 728 | + '<methodTypeHint>' => $methodTypeHint, |
|
| 729 | + '<variableType>' => $variableType, |
|
| 730 | + '<variableName>' => $variableName, |
|
| 731 | + '<methodName>' => $methodName, |
|
| 732 | + '<fieldName>' => $fieldName, |
|
| 733 | + '<variableDefault>' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '' |
|
| 734 | 734 | ); |
| 735 | 735 | |
| 736 | 736 | $method = str_replace( |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | $body = str_replace('<spaces>', $this->spaces, $body); |
| 367 | 367 | $last = strrpos($currentCode, '}'); |
| 368 | 368 | |
| 369 | - return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : '') . "}\n"; |
|
| 369 | + return substr($currentCode, 0, $last).$body.(strlen($body) > 0 ? "\n" : '')."}\n"; |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | /** |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | protected function generateEntityNamespace() |
| 376 | 376 | { |
| 377 | 377 | if ($this->hasNamespace($this->mapperInfo->className())) { |
| 378 | - return 'namespace ' . $this->getNamespace($this->mapperInfo->className()) .';' . "\n\n"; |
|
| 378 | + return 'namespace '.$this->getNamespace($this->mapperInfo->className()).';'."\n\n"; |
|
| 379 | 379 | } |
| 380 | 380 | } |
| 381 | 381 | |
@@ -389,18 +389,18 @@ discard block |
||
| 389 | 389 | $use = []; |
| 390 | 390 | |
| 391 | 391 | if ($this->hasNamespace($this->getClassToExtend())) { |
| 392 | - $use[$this->getClassToExtend()] = 'use ' . $this->getClassToExtend() . ';'; |
|
| 392 | + $use[$this->getClassToExtend()] = 'use '.$this->getClassToExtend().';'; |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | foreach ($this->interfaces as $interface) { |
| 396 | 396 | if ($this->hasNamespace($interface)) { |
| 397 | - $use[$interface] = 'use ' . $interface . ';'; |
|
| 397 | + $use[$interface] = 'use '.$interface.';'; |
|
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | foreach ($this->traits as $trait) { |
| 402 | 402 | if ($this->hasNamespace($trait)) { |
| 403 | - $use[$trait] = 'use ' . $trait . ';'; |
|
| 403 | + $use[$trait] = 'use '.$trait.';'; |
|
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | |
| 431 | 431 | sort($use); |
| 432 | 432 | |
| 433 | - return implode("\n", $use) . "\n\n"; |
|
| 433 | + return implode("\n", $use)."\n\n"; |
|
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | /** |
@@ -438,9 +438,9 @@ discard block |
||
| 438 | 438 | */ |
| 439 | 439 | protected function generateEntityClassName() |
| 440 | 440 | { |
| 441 | - return 'class ' . $this->getClassName($this->mapperInfo->className()) . |
|
| 442 | - ($this->classToExtend ? ' extends ' . $this->getClassToExtendName() : null) . |
|
| 443 | - ($this->interfaces ? ' implements ' . $this->getInterfacesToImplement() : null); |
|
| 441 | + return 'class '.$this->getClassName($this->mapperInfo->className()). |
|
| 442 | + ($this->classToExtend ? ' extends '.$this->getClassToExtendName() : null). |
|
| 443 | + ($this->interfaces ? ' implements '.$this->getInterfacesToImplement() : null); |
|
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | /** |
@@ -455,10 +455,10 @@ discard block |
||
| 455 | 455 | $traits = ''; |
| 456 | 456 | |
| 457 | 457 | foreach ($this->traits as $trait) { |
| 458 | - $traits .= $this->spaces . 'use ' . $this->getRelativeClassName($trait) . ';' . "\n"; |
|
| 458 | + $traits .= $this->spaces.'use '.$this->getRelativeClassName($trait).';'."\n"; |
|
| 459 | 459 | } |
| 460 | 460 | |
| 461 | - return $traits . "\n"; |
|
| 461 | + return $traits."\n"; |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | /** |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | { |
| 564 | 564 | $lines = array(); |
| 565 | 565 | $lines[] = '/**'; |
| 566 | - $lines[] = ' * ' . $this->getClassName($this->mapperInfo->className()); |
|
| 566 | + $lines[] = ' * '.$this->getClassName($this->mapperInfo->className()); |
|
| 567 | 567 | $lines[] = ' */'; |
| 568 | 568 | |
| 569 | 569 | return implode("\n", $lines); |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | $variableName = $this->inflector->camelize($fieldName); |
| 695 | 695 | $methodName = $variableName; |
| 696 | 696 | } else { |
| 697 | - $methodName = $type . $this->inflector->classify($fieldName); |
|
| 697 | + $methodName = $type.$this->inflector->classify($fieldName); |
|
| 698 | 698 | $variableName = $this->inflector->camelize($fieldName); |
| 699 | 699 | } |
| 700 | 700 | |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | |
| 712 | 712 | if ($propertyInfo->isObject()) { |
| 713 | 713 | $variableType = $this->getRelativeClassName($propertyInfo->className()); |
| 714 | - $methodTypeHint = $variableType.' '; |
|
| 714 | + $methodTypeHint = $variableType.' '; |
|
| 715 | 715 | } else { |
| 716 | 716 | $variableType = $propertyInfo->phpType(); |
| 717 | 717 | $methodTypeHint = null; |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | '<variableName>' => $variableName, |
| 741 | 741 | '<methodName>' => $methodName, |
| 742 | 742 | '<fieldName>' => $fieldName, |
| 743 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '' |
|
| 743 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '' |
|
| 744 | 744 | ); |
| 745 | 745 | |
| 746 | 746 | $method = str_replace( |
@@ -815,9 +815,9 @@ discard block |
||
| 815 | 815 | protected function generateFieldMappingPropertyDocBlock($property) |
| 816 | 816 | { |
| 817 | 817 | $lines = array(); |
| 818 | - $lines[] = $this->spaces . '/**'; |
|
| 819 | - $lines[] = $this->spaces . ' * @var '.$property->phpType(); |
|
| 820 | - $lines[] = $this->spaces . ' */'; |
|
| 818 | + $lines[] = $this->spaces.'/**'; |
|
| 819 | + $lines[] = $this->spaces.' * @var '.$property->phpType(); |
|
| 820 | + $lines[] = $this->spaces.' */'; |
|
| 821 | 821 | |
| 822 | 822 | return implode("\n", $lines); |
| 823 | 823 | } |
@@ -846,9 +846,9 @@ discard block |
||
| 846 | 846 | } |
| 847 | 847 | |
| 848 | 848 | $lines = array(); |
| 849 | - $lines[] = $this->spaces . '/**'; |
|
| 850 | - $lines[] = $this->spaces . ' * @var '.$className; |
|
| 851 | - $lines[] = $this->spaces . ' */'; |
|
| 849 | + $lines[] = $this->spaces.'/**'; |
|
| 850 | + $lines[] = $this->spaces.' * @var '.$className; |
|
| 851 | + $lines[] = $this->spaces.' */'; |
|
| 852 | 852 | |
| 853 | 853 | return implode("\n", $lines); |
| 854 | 854 | } |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | |
| 890 | 890 | if ($inClass) { |
| 891 | 891 | $inClass = false; |
| 892 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
| 892 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
| 893 | 893 | $this->staticReflection[$lastSeenClass]['properties'] = array(); |
| 894 | 894 | $this->staticReflection[$lastSeenClass]['methods'] = array(); |
| 895 | 895 | } |
@@ -897,16 +897,16 @@ discard block |
||
| 897 | 897 | if ($token[0] == T_NAMESPACE) { |
| 898 | 898 | $lastSeenNamespace = ""; |
| 899 | 899 | $inNamespace = true; |
| 900 | - } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) { |
|
| 900 | + } elseif ($token[0] == T_CLASS && $tokens[$i - 1][0] != T_DOUBLE_COLON) { |
|
| 901 | 901 | $inClass = true; |
| 902 | 902 | } elseif ($token[0] == T_FUNCTION) { |
| 903 | - if ($tokens[$i+2][0] == T_STRING) { |
|
| 904 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
| 905 | - } elseif ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) { |
|
| 906 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
| 903 | + if ($tokens[$i + 2][0] == T_STRING) { |
|
| 904 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
| 905 | + } elseif ($tokens[$i + 2] == "&" && $tokens[$i + 3][0] == T_STRING) { |
|
| 906 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
| 907 | 907 | } |
| 908 | - } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i+2][0] != T_FUNCTION) { |
|
| 909 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
| 908 | + } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i + 2][0] != T_FUNCTION) { |
|
| 909 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
| 910 | 910 | } |
| 911 | 911 | } |
| 912 | 912 | } |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | if ($this->hasNamespace($className)) { |
| 982 | 982 | return $this->getClassName($className); |
| 983 | 983 | } else { |
| 984 | - return '\\' . $className; |
|
| 984 | + return '\\'.$className; |
|
| 985 | 985 | } |
| 986 | 986 | } |
| 987 | 987 | |
@@ -1082,8 +1082,8 @@ discard block |
||
| 1082 | 1082 | $lines = explode("\n", $code); |
| 1083 | 1083 | |
| 1084 | 1084 | foreach ($lines as $key => $value) { |
| 1085 | - if ( ! empty($value)) { |
|
| 1086 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
| 1085 | + if (!empty($value)) { |
|
| 1086 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
| 1087 | 1087 | } |
| 1088 | 1088 | } |
| 1089 | 1089 | |
@@ -1112,7 +1112,7 @@ discard block |
||
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | if (is_string($value)) { |
| 1115 | - return "'" . $value . "'"; |
|
| 1115 | + return "'".$value."'"; |
|
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | 1118 | if (is_bool($value)) { |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | public function setFieldVisibility(string $visibility): void |
| 1250 | 1250 | { |
| 1251 | 1251 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
| 1252 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
| 1252 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
| 1253 | 1253 | } |
| 1254 | 1254 | |
| 1255 | 1255 | $this->fieldVisibility = $visibility; |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | */ |
| 92 | 92 | public function join($query, $alias = null) |
| 93 | 93 | { |
| 94 | - $parts = explode('#', (string)$alias); |
|
| 94 | + $parts = explode('#', (string) $alias); |
|
| 95 | 95 | |
| 96 | 96 | if (!isset($parts[1])) { |
| 97 | 97 | throw new \LogicException('Joins are not supported on polymorph without discriminator'); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * |
| 40 | 40 | * @param string $type |
| 41 | 41 | */ |
| 42 | - public function declare(string $type): void |
|
| 42 | + public function declare(string$type): void |
|
| 43 | 43 | { |
| 44 | 44 | if (isset($this->declaredTypes[$type])) { |
| 45 | 45 | return; |