@@ -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( |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | $body = str_replace('<spaces>', $this->spaces, $body); |
387 | 387 | $last = strrpos($currentCode, '}'); |
388 | 388 | |
389 | - return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : '') . "}\n"; |
|
389 | + return substr($currentCode, 0, $last).$body.(strlen($body) > 0 ? "\n" : '')."}\n"; |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | /** |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | protected function generateEntityNamespace() |
396 | 396 | { |
397 | 397 | if ($this->hasNamespace($this->mapperInfo->className())) { |
398 | - return 'namespace ' . $this->getNamespace($this->mapperInfo->className()) .';' . "\n\n"; |
|
398 | + return 'namespace '.$this->getNamespace($this->mapperInfo->className()).';'."\n\n"; |
|
399 | 399 | } |
400 | 400 | } |
401 | 401 | |
@@ -409,18 +409,18 @@ discard block |
||
409 | 409 | $use = []; |
410 | 410 | |
411 | 411 | if ($this->hasNamespace($this->getClassToExtend())) { |
412 | - $use[$this->getClassToExtend()] = 'use ' . $this->getClassToExtend() . ';'; |
|
412 | + $use[$this->getClassToExtend()] = 'use '.$this->getClassToExtend().';'; |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | foreach ($this->interfaces as $interface) { |
416 | 416 | if ($this->hasNamespace($interface)) { |
417 | - $use[$interface] = 'use ' . $interface . ';'; |
|
417 | + $use[$interface] = 'use '.$interface.';'; |
|
418 | 418 | } |
419 | 419 | } |
420 | 420 | |
421 | 421 | foreach ($this->traits as $trait) { |
422 | 422 | if ($this->hasNamespace($trait)) { |
423 | - $use[$trait] = 'use ' . $trait . ';'; |
|
423 | + $use[$trait] = 'use '.$trait.';'; |
|
424 | 424 | } |
425 | 425 | } |
426 | 426 | |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | |
451 | 451 | sort($use); |
452 | 452 | |
453 | - return implode("\n", $use) . "\n\n"; |
|
453 | + return implode("\n", $use)."\n\n"; |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
@@ -458,9 +458,9 @@ discard block |
||
458 | 458 | */ |
459 | 459 | protected function generateEntityClassName() |
460 | 460 | { |
461 | - return 'class ' . $this->getClassName($this->mapperInfo->className()) . |
|
462 | - ($this->classToExtend ? ' extends ' . $this->getClassToExtendName() : null) . |
|
463 | - ($this->interfaces ? ' implements ' . $this->getInterfacesToImplement() : null); |
|
461 | + return 'class '.$this->getClassName($this->mapperInfo->className()). |
|
462 | + ($this->classToExtend ? ' extends '.$this->getClassToExtendName() : null). |
|
463 | + ($this->interfaces ? ' implements '.$this->getInterfacesToImplement() : null); |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | /** |
@@ -475,10 +475,10 @@ discard block |
||
475 | 475 | $traits = ''; |
476 | 476 | |
477 | 477 | foreach ($this->traits as $trait) { |
478 | - $traits .= $this->spaces . 'use ' . $this->getRelativeClassName($trait) . ';' . "\n"; |
|
478 | + $traits .= $this->spaces.'use '.$this->getRelativeClassName($trait).';'."\n"; |
|
479 | 479 | } |
480 | 480 | |
481 | - return $traits . "\n"; |
|
481 | + return $traits."\n"; |
|
482 | 482 | } |
483 | 483 | |
484 | 484 | /** |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | { |
584 | 584 | $lines = array(); |
585 | 585 | $lines[] = '/**'; |
586 | - $lines[] = ' * ' . $this->getClassName($this->mapperInfo->className()); |
|
586 | + $lines[] = ' * '.$this->getClassName($this->mapperInfo->className()); |
|
587 | 587 | $lines[] = ' */'; |
588 | 588 | |
589 | 589 | return implode("\n", $lines); |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | |
684 | 684 | if (!$property->isRelation()) { |
685 | 685 | $lines[] = $this->generateEmbeddedPropertyDocBlock($property); |
686 | - $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property) . ' $'.$property->name().";\n"; |
|
686 | + $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property).' $'.$property->name().";\n"; |
|
687 | 687 | } else { |
688 | 688 | $name = $property->name(); |
689 | 689 | $default = ''; |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | } |
700 | 700 | |
701 | 701 | $lines[] = $this->generateEmbeddedPropertyDocBlock($property); |
702 | - $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property) . ' $' . $name . $default .";\n"; |
|
702 | + $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property).' $'.$name.$default.";\n"; |
|
703 | 703 | } |
704 | 704 | } |
705 | 705 | |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | $variableName = $this->inflector->camelize($fieldName); |
728 | 728 | $methodName = $variableName; |
729 | 729 | } else { |
730 | - $methodName = $type . $this->inflector->classify($fieldName); |
|
730 | + $methodName = $type.$this->inflector->classify($fieldName); |
|
731 | 731 | $variableName = $this->inflector->camelize($fieldName); |
732 | 732 | } |
733 | 733 | |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | |
745 | 745 | if ($propertyInfo->isObject()) { |
746 | 746 | $variableType = $this->getRelativeClassName($propertyInfo->className()); |
747 | - $methodTypeHint = $variableType.' '; |
|
747 | + $methodTypeHint = $variableType.' '; |
|
748 | 748 | } else { |
749 | 749 | $variableType = $propertyInfo->phpType(); |
750 | 750 | $methodTypeHint = null; |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | '<variableName>' => $variableName, |
774 | 774 | '<methodName>' => $methodName, |
775 | 775 | '<fieldName>' => $fieldName, |
776 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '' |
|
776 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '' |
|
777 | 777 | ); |
778 | 778 | |
779 | 779 | $method = str_replace( |
@@ -848,9 +848,9 @@ discard block |
||
848 | 848 | protected function generateFieldMappingPropertyDocBlock($property) |
849 | 849 | { |
850 | 850 | $lines = array(); |
851 | - $lines[] = $this->spaces . '/**'; |
|
852 | - $lines[] = $this->spaces . ' * @var '.$property->phpType(); |
|
853 | - $lines[] = $this->spaces . ' */'; |
|
851 | + $lines[] = $this->spaces.'/**'; |
|
852 | + $lines[] = $this->spaces.' * @var '.$property->phpType(); |
|
853 | + $lines[] = $this->spaces.' */'; |
|
854 | 854 | |
855 | 855 | return implode("\n", $lines); |
856 | 856 | } |
@@ -879,9 +879,9 @@ discard block |
||
879 | 879 | } |
880 | 880 | |
881 | 881 | $lines = array(); |
882 | - $lines[] = $this->spaces . '/**'; |
|
883 | - $lines[] = $this->spaces . ' * @var '.$className; |
|
884 | - $lines[] = $this->spaces . ' */'; |
|
882 | + $lines[] = $this->spaces.'/**'; |
|
883 | + $lines[] = $this->spaces.' * @var '.$className; |
|
884 | + $lines[] = $this->spaces.' */'; |
|
885 | 885 | |
886 | 886 | return implode("\n", $lines); |
887 | 887 | } |
@@ -922,7 +922,7 @@ discard block |
||
922 | 922 | |
923 | 923 | if ($inClass) { |
924 | 924 | $inClass = false; |
925 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
925 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
926 | 926 | $this->staticReflection[$lastSeenClass]['properties'] = array(); |
927 | 927 | $this->staticReflection[$lastSeenClass]['methods'] = array(); |
928 | 928 | } |
@@ -930,16 +930,16 @@ discard block |
||
930 | 930 | if ($token[0] == T_NAMESPACE) { |
931 | 931 | $lastSeenNamespace = ""; |
932 | 932 | $inNamespace = true; |
933 | - } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) { |
|
933 | + } elseif ($token[0] == T_CLASS && $tokens[$i - 1][0] != T_DOUBLE_COLON) { |
|
934 | 934 | $inClass = true; |
935 | 935 | } elseif ($token[0] == T_FUNCTION) { |
936 | - if ($tokens[$i+2][0] == T_STRING) { |
|
937 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
938 | - } elseif ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) { |
|
939 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
936 | + if ($tokens[$i + 2][0] == T_STRING) { |
|
937 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
938 | + } elseif ($tokens[$i + 2] == "&" && $tokens[$i + 3][0] == T_STRING) { |
|
939 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
940 | 940 | } |
941 | - } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i+2][0] != T_FUNCTION) { |
|
942 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
941 | + } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i + 2][0] != T_FUNCTION) { |
|
942 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
943 | 943 | } |
944 | 944 | } |
945 | 945 | } |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | if ($this->hasNamespace($className)) { |
1015 | 1015 | return $this->getClassName($className); |
1016 | 1016 | } else { |
1017 | - return '\\' . $className; |
|
1017 | + return '\\'.$className; |
|
1018 | 1018 | } |
1019 | 1019 | } |
1020 | 1020 | |
@@ -1115,8 +1115,8 @@ discard block |
||
1115 | 1115 | $lines = explode("\n", $code); |
1116 | 1116 | |
1117 | 1117 | foreach ($lines as $key => $value) { |
1118 | - if ( ! empty($value)) { |
|
1119 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
1118 | + if (!empty($value)) { |
|
1119 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
1120 | 1120 | } |
1121 | 1121 | } |
1122 | 1122 | |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | } |
1146 | 1146 | |
1147 | 1147 | if (is_string($value)) { |
1148 | - return "'" . $value . "'"; |
|
1148 | + return "'".$value."'"; |
|
1149 | 1149 | } |
1150 | 1150 | |
1151 | 1151 | if (is_bool($value)) { |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | $type = self::PROPERTY_TYPE_MAP[$type] ?? $type; |
1179 | 1179 | } |
1180 | 1180 | |
1181 | - return ($nullable ? '?' : '') . $type; |
|
1181 | + return ($nullable ? '?' : '').$type; |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | /** |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | return ''; |
1198 | 1198 | } |
1199 | 1199 | |
1200 | - return ' ' . $this->getPropertyTypeHint($property->phpType(), $property->isNullable()); |
|
1200 | + return ' '.$this->getPropertyTypeHint($property->phpType(), $property->isNullable()); |
|
1201 | 1201 | } |
1202 | 1202 | |
1203 | 1203 | /** |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | } |
1232 | 1232 | } |
1233 | 1233 | |
1234 | - return ' ' . $this->getPropertyTypeHint($type, $property->isRelation()); |
|
1234 | + return ' '.$this->getPropertyTypeHint($type, $property->isRelation()); |
|
1235 | 1235 | } |
1236 | 1236 | |
1237 | 1237 | //---------------------- mutators |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | public function setFieldVisibility(string $visibility): void |
1362 | 1362 | { |
1363 | 1363 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
1364 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
1364 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
1365 | 1365 | } |
1366 | 1366 | |
1367 | 1367 | $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; |