@@ -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) { |
|
72 | + $parameters = implode(', ', array_map(function($p) { |
|
73 | 73 | return '$'.$p; |
74 | 74 | }, $properties)); |
75 | 75 | $content = ''; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $content .= $this->eol; |
80 | 80 | } |
81 | 81 | |
82 | - $content .= '$this->' . $property . ' = $' . $property . ';'; |
|
82 | + $content .= '$this->'.$property.' = $'.$property.';'; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | { |
104 | 104 | $spaces = str_repeat($this->tab, $tabs); |
105 | 105 | |
106 | - return $spaces . str_replace($this->eol, $this->eol.$spaces, $code); |
|
106 | + return $spaces.str_replace($this->eol, $this->eol.$spaces, $code); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * |
161 | 161 | * @return string |
162 | 162 | */ |
163 | - public function switch($varName, array $cases, $default = null) |
|
163 | + public function switch ($varName, array $cases, $default = null) |
|
164 | 164 | { |
165 | 165 | $code = 'switch ('.$varName.') {'.$this->eol; |
166 | 166 |
@@ -772,13 +772,13 @@ |
||
772 | 772 | } |
773 | 773 | |
774 | 774 | $replacements = [ |
775 | - '<description>' => ucfirst($type).' '.$variableName, |
|
776 | - '<methodTypeHint>' => $methodTypeHint, |
|
777 | - '<variableType>' => $variableType, |
|
778 | - '<variableName>' => $variableName, |
|
779 | - '<methodName>' => $methodName, |
|
780 | - '<fieldName>' => $fieldName, |
|
781 | - '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '' |
|
775 | + '<description>' => ucfirst($type).' '.$variableName, |
|
776 | + '<methodTypeHint>' => $methodTypeHint, |
|
777 | + '<variableType>' => $variableType, |
|
778 | + '<variableName>' => $variableName, |
|
779 | + '<methodName>' => $methodName, |
|
780 | + '<fieldName>' => $fieldName, |
|
781 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '' |
|
782 | 782 | ]; |
783 | 783 | |
784 | 784 | $method = str_replace( |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $body = str_replace('<spaces>', $this->spaces, $body); |
408 | 408 | $last = strrpos($currentCode, '}'); |
409 | 409 | |
410 | - return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : '') . "}\n"; |
|
410 | + return substr($currentCode, 0, $last).$body.(strlen($body) > 0 ? "\n" : '')."}\n"; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | /** |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | protected function generateEntityNamespace(): string |
417 | 417 | { |
418 | 418 | if ($this->hasNamespace($this->mapperInfo->className())) { |
419 | - return 'namespace ' . $this->getNamespace($this->mapperInfo->className()) .';' . "\n\n"; |
|
419 | + return 'namespace '.$this->getNamespace($this->mapperInfo->className()).';'."\n\n"; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | return ''; |
@@ -432,18 +432,18 @@ discard block |
||
432 | 432 | $use = []; |
433 | 433 | |
434 | 434 | if (($parentClass = $this->getClassToExtend()) && $this->hasNamespace($parentClass)) { |
435 | - $use[$parentClass] = 'use ' . $parentClass . ';'; |
|
435 | + $use[$parentClass] = 'use '.$parentClass.';'; |
|
436 | 436 | } |
437 | 437 | |
438 | 438 | foreach ($this->interfaces as $interface) { |
439 | 439 | if ($this->hasNamespace($interface)) { |
440 | - $use[$interface] = 'use ' . $interface . ';'; |
|
440 | + $use[$interface] = 'use '.$interface.';'; |
|
441 | 441 | } |
442 | 442 | } |
443 | 443 | |
444 | 444 | foreach ($this->traits as $trait) { |
445 | 445 | if ($this->hasNamespace($trait)) { |
446 | - $use[$trait] = 'use ' . $trait . ';'; |
|
446 | + $use[$trait] = 'use '.$trait.';'; |
|
447 | 447 | } |
448 | 448 | } |
449 | 449 | |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | |
474 | 474 | sort($use); |
475 | 475 | |
476 | - return implode("\n", $use) . "\n\n"; |
|
476 | + return implode("\n", $use)."\n\n"; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | /** |
@@ -481,9 +481,9 @@ discard block |
||
481 | 481 | */ |
482 | 482 | protected function generateEntityClassName() |
483 | 483 | { |
484 | - return 'class ' . $this->getClassName($this->mapperInfo->className()) . |
|
485 | - ($this->classToExtend ? ' extends ' . $this->getClassToExtendName() : null) . |
|
486 | - ($this->interfaces ? ' implements ' . $this->getInterfacesToImplement() : null); |
|
484 | + return 'class '.$this->getClassName($this->mapperInfo->className()). |
|
485 | + ($this->classToExtend ? ' extends '.$this->getClassToExtendName() : null). |
|
486 | + ($this->interfaces ? ' implements '.$this->getInterfacesToImplement() : null); |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | /** |
@@ -498,10 +498,10 @@ discard block |
||
498 | 498 | $traits = ''; |
499 | 499 | |
500 | 500 | foreach ($this->traits as $trait) { |
501 | - $traits .= $this->spaces . 'use ' . $this->getRelativeClassName($trait) . ';' . "\n"; |
|
501 | + $traits .= $this->spaces.'use '.$this->getRelativeClassName($trait).';'."\n"; |
|
502 | 502 | } |
503 | 503 | |
504 | - return $traits . "\n"; |
|
504 | + return $traits."\n"; |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | /** |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | { |
669 | 669 | $lines = []; |
670 | 670 | $lines[] = '/**'; |
671 | - $lines[] = ' * ' . $this->getClassName($this->mapperInfo->className()); |
|
671 | + $lines[] = ' * '.$this->getClassName($this->mapperInfo->className()); |
|
672 | 672 | $lines[] = ' */'; |
673 | 673 | |
674 | 674 | return implode("\n", $lines); |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | $default = $this->useConstructorPropertyPromotion ? ' = null' : ''; |
773 | 773 | |
774 | 774 | $lines[] = $this->generateEmbeddedPropertyDocBlock($property); |
775 | - $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property, $forceNullable) . ' $'.$property->name().$default.";\n"; |
|
775 | + $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property, $forceNullable).' $'.$property->name().$default.";\n"; |
|
776 | 776 | } else { |
777 | 777 | $name = $property->name(); |
778 | 778 | $default = ''; |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | } |
789 | 789 | |
790 | 790 | $lines[] = $this->generateEmbeddedPropertyDocBlock($property); |
791 | - $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property, $forceNullable) . ' $' . $name . $default .";\n"; |
|
791 | + $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property, $forceNullable).' $'.$name.$default.";\n"; |
|
792 | 792 | } |
793 | 793 | } |
794 | 794 | |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | $variableName = $this->inflector->camelize($fieldName); |
817 | 817 | $methodName = $variableName; |
818 | 818 | } else { |
819 | - $methodName = $type . $this->inflector->classify($fieldName); |
|
819 | + $methodName = $type.$this->inflector->classify($fieldName); |
|
820 | 820 | $variableName = $this->inflector->camelize($fieldName); |
821 | 821 | } |
822 | 822 | |
@@ -942,9 +942,9 @@ discard block |
||
942 | 942 | protected function generateFieldMappingPropertyDocBlock($property) |
943 | 943 | { |
944 | 944 | $lines = []; |
945 | - $lines[] = $this->spaces . '/**'; |
|
946 | - $lines[] = $this->spaces . ' * @var '.$property->phpType(); |
|
947 | - $lines[] = $this->spaces . ' */'; |
|
945 | + $lines[] = $this->spaces.'/**'; |
|
946 | + $lines[] = $this->spaces.' * @var '.$property->phpType(); |
|
947 | + $lines[] = $this->spaces.' */'; |
|
948 | 948 | |
949 | 949 | return implode("\n", $lines); |
950 | 950 | } |
@@ -973,9 +973,9 @@ discard block |
||
973 | 973 | } |
974 | 974 | |
975 | 975 | $lines = []; |
976 | - $lines[] = $this->spaces . '/**'; |
|
977 | - $lines[] = $this->spaces . ' * @var '.$className; |
|
978 | - $lines[] = $this->spaces . ' */'; |
|
976 | + $lines[] = $this->spaces.'/**'; |
|
977 | + $lines[] = $this->spaces.' * @var '.$className; |
|
978 | + $lines[] = $this->spaces.' */'; |
|
979 | 979 | |
980 | 980 | return implode("\n", $lines); |
981 | 981 | } |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | |
1017 | 1017 | if ($inClass) { |
1018 | 1018 | $inClass = false; |
1019 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
1019 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
1020 | 1020 | $this->staticReflection[$lastSeenClass]['properties'] = []; |
1021 | 1021 | $this->staticReflection[$lastSeenClass]['methods'] = []; |
1022 | 1022 | } |
@@ -1024,16 +1024,16 @@ discard block |
||
1024 | 1024 | if ($token[0] == T_NAMESPACE) { |
1025 | 1025 | $lastSeenNamespace = ""; |
1026 | 1026 | $inNamespace = true; |
1027 | - } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) { |
|
1027 | + } elseif ($token[0] == T_CLASS && $tokens[$i - 1][0] != T_DOUBLE_COLON) { |
|
1028 | 1028 | $inClass = true; |
1029 | 1029 | } elseif ($token[0] == T_FUNCTION) { |
1030 | - if ($tokens[$i+2][0] == T_STRING) { |
|
1031 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
1032 | - } elseif ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) { |
|
1033 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
1030 | + if ($tokens[$i + 2][0] == T_STRING) { |
|
1031 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
1032 | + } elseif ($tokens[$i + 2] == "&" && $tokens[$i + 3][0] == T_STRING) { |
|
1033 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
1034 | 1034 | } |
1035 | - } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED]) && $tokens[$i+2][0] != T_FUNCTION) { |
|
1036 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
1035 | + } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED]) && $tokens[$i + 2][0] != T_FUNCTION) { |
|
1036 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
1037 | 1037 | } |
1038 | 1038 | } |
1039 | 1039 | } |
@@ -1108,7 +1108,7 @@ discard block |
||
1108 | 1108 | if ($this->hasNamespace($className)) { |
1109 | 1109 | return $this->getClassName($className); |
1110 | 1110 | } else { |
1111 | - return '\\' . $className; |
|
1111 | + return '\\'.$className; |
|
1112 | 1112 | } |
1113 | 1113 | } |
1114 | 1114 | |
@@ -1209,8 +1209,8 @@ discard block |
||
1209 | 1209 | $lines = explode("\n", $code); |
1210 | 1210 | |
1211 | 1211 | foreach ($lines as $key => $value) { |
1212 | - if (! empty($value)) { |
|
1213 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
1212 | + if (!empty($value)) { |
|
1213 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
1214 | 1214 | } |
1215 | 1215 | } |
1216 | 1216 | |
@@ -1239,7 +1239,7 @@ discard block |
||
1239 | 1239 | } |
1240 | 1240 | |
1241 | 1241 | if (is_string($value)) { |
1242 | - return "'" . $value . "'"; |
|
1242 | + return "'".$value."'"; |
|
1243 | 1243 | } |
1244 | 1244 | |
1245 | 1245 | if (is_bool($value)) { |
@@ -1272,7 +1272,7 @@ discard block |
||
1272 | 1272 | $type = self::PROPERTY_TYPE_MAP[$type] ?? $type; |
1273 | 1273 | } |
1274 | 1274 | |
1275 | - return ($nullable ? '?' : '') . $type; |
|
1275 | + return ($nullable ? '?' : '').$type; |
|
1276 | 1276 | } |
1277 | 1277 | |
1278 | 1278 | /** |
@@ -1292,7 +1292,7 @@ discard block |
||
1292 | 1292 | return ''; |
1293 | 1293 | } |
1294 | 1294 | |
1295 | - return ' ' . $this->getPropertyTypeHint($property->phpType(), $forceNullable || $property->isNullable()); |
|
1295 | + return ' '.$this->getPropertyTypeHint($property->phpType(), $forceNullable || $property->isNullable()); |
|
1296 | 1296 | } |
1297 | 1297 | |
1298 | 1298 | /** |
@@ -1327,7 +1327,7 @@ discard block |
||
1327 | 1327 | } |
1328 | 1328 | } |
1329 | 1329 | |
1330 | - return ' ' . $this->getPropertyTypeHint($type, $forceNullable || $property->isRelation()); |
|
1330 | + return ' '.$this->getPropertyTypeHint($type, $forceNullable || $property->isRelation()); |
|
1331 | 1331 | } |
1332 | 1332 | |
1333 | 1333 | //---------------------- mutators |
@@ -1461,7 +1461,7 @@ discard block |
||
1461 | 1461 | public function setFieldVisibility(string $visibility): void |
1462 | 1462 | { |
1463 | 1463 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
1464 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
1464 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
1465 | 1465 | } |
1466 | 1466 | |
1467 | 1467 | $this->fieldVisibility = $visibility; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function __toString() |
38 | 38 | { |
39 | - return (string)$this->value; |
|
39 | + return (string) $this->value; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -51,10 +51,10 @@ |
||
51 | 51 | { |
52 | 52 | if ($this->cacheKey === null) { |
53 | 53 | $this->cacheKey = new CacheKey( |
54 | - function () { |
|
54 | + function() { |
|
55 | 55 | return $this->cacheNamespace(); |
56 | 56 | }, |
57 | - $key ?? function () { |
|
57 | + $key ?? function() { |
|
58 | 58 | return $this->cacheKey(); |
59 | 59 | }, |
60 | 60 | $lifetime |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | $query->joinEntity( |
48 | 48 | $this->distant->entityName(), |
49 | - function (JoinClause $clause) use ($alias, $query) { |
|
49 | + function(JoinClause $clause) use ($alias, $query) { |
|
50 | 50 | $this->buildJoinClause($clause, $query, $alias); |
51 | 51 | }, |
52 | 52 | null, |
@@ -180,21 +180,21 @@ |
||
180 | 180 | if ($default !== null) { |
181 | 181 | switch ($type) { |
182 | 182 | case TypeInterface::BOOLEAN: |
183 | - $default = (bool)$default; |
|
183 | + $default = (bool) $default; |
|
184 | 184 | break; |
185 | 185 | |
186 | 186 | case TypeInterface::TINYINT: |
187 | 187 | case TypeInterface::SMALLINT: |
188 | 188 | case TypeInterface::INTEGER: |
189 | - $default = (int)$default; |
|
189 | + $default = (int) $default; |
|
190 | 190 | break; |
191 | 191 | |
192 | 192 | case TypeInterface::FLOAT: |
193 | - $default = (float)$default; |
|
193 | + $default = (float) $default; |
|
194 | 194 | break; |
195 | 195 | |
196 | 196 | case TypeInterface::DOUBLE: |
197 | - $default = (float)$default; |
|
197 | + $default = (float) $default; |
|
198 | 198 | break; |
199 | 199 | } |
200 | 200 |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | #[ReadOperation] |
78 | 78 | public function load($relations) |
79 | 79 | { |
80 | - foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) { |
|
80 | + foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) { |
|
81 | 81 | $this->repository->relation($relationName)->load( |
82 | 82 | EntityIndexer::fromArray($this->repository->mapper(), $this->storage->all()), |
83 | 83 | $meta['relations'], |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | #[WriteOperation] |
143 | 143 | public function delete() |
144 | 144 | { |
145 | - $this->repository->transaction(function (RepositoryInterface $repository) { |
|
145 | + $this->repository->transaction(function(RepositoryInterface $repository) { |
|
146 | 146 | /** @var RepositoryInterface&RepositoryEventsSubscriberInterface $repository */ |
147 | 147 | $writer = new BufferedWriter($repository); |
148 | 148 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | #[WriteOperation] |
166 | 166 | public function save() |
167 | 167 | { |
168 | - $this->repository->transaction(function (RepositoryInterface $repository) { |
|
168 | + $this->repository->transaction(function(RepositoryInterface $repository) { |
|
169 | 169 | foreach ($this as $entity) { |
170 | 170 | $repository->save($entity); |
171 | 171 | } |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | #[WriteOperation] |
187 | 187 | public function saveAll($relations) |
188 | 188 | { |
189 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
189 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
190 | 190 | |
191 | - return $this->repository->transaction(function (RepositoryInterface $repository) use ($relations) { |
|
191 | + return $this->repository->transaction(function(RepositoryInterface $repository) use ($relations) { |
|
192 | 192 | $nb = 0; |
193 | 193 | |
194 | 194 | foreach ($this as $entity) { |
@@ -215,9 +215,9 @@ discard block |
||
215 | 215 | #[WriteOperation] |
216 | 216 | public function deleteAll($relations) |
217 | 217 | { |
218 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
218 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
219 | 219 | |
220 | - return $this->repository->transaction(function (RepositoryInterface $repository) use ($relations) { |
|
220 | + return $this->repository->transaction(function(RepositoryInterface $repository) use ($relations) { |
|
221 | 221 | $nb = 0; |
222 | 222 | |
223 | 223 | foreach ($this as $entity) { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | throw new \LogicException('Custom mode should only used with callable callback'); |
230 | 230 | } |
231 | 231 | |
232 | - $groupBy = function ($item, $key, $results) use ($groupBy) { |
|
232 | + $groupBy = function($item, $key, $results) use ($groupBy) { |
|
233 | 233 | return $this->getDataFromItem($item, $groupBy); |
234 | 234 | }; |
235 | 235 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | return $items->all(); |
331 | 331 | } |
332 | 332 | |
333 | - return (array)$items; |
|
333 | + return (array) $items; |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace Bdf\Prime; |
4 | 4 | |
5 | -require_once __DIR__ . '/_files/BenchData.php'; |
|
5 | +require_once __DIR__.'/_files/BenchData.php'; |
|
6 | 6 | |
7 | 7 | use Bdf\Prime\Bench\BenchData; |
8 | 8 | use Bdf\Prime\Bench\EntityArrayOf; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $entities[] = new EntityNotTypedArray([ |
71 | 71 | 'floats' => $this->randArray('double', self::SCALAR_COUNT), |
72 | 72 | 'booleans' => $this->randArray('boolean', self::SCALAR_COUNT), |
73 | - 'dates' => array_map(function (\DateTime $dateTime) { return $dateTime->format(\DateTime::ISO8601); }, $this->randArray('datetime', self::DATEIME_COUNT)), |
|
73 | + 'dates' => array_map(function(\DateTime $dateTime) { return $dateTime->format(\DateTime::ISO8601); }, $this->randArray('datetime', self::DATEIME_COUNT)), |
|
74 | 74 | ]); |
75 | 75 | } |
76 | 76 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | foreach ($this->notTypedRepository->all() as $entity) { |
106 | 106 | $entity->booleans = array_map('boolval', $entity->booleans); |
107 | 107 | $entity->floats = array_map('doubleval', $entity->floats); |
108 | - $entity->dates = array_map(function ($str) { return \DateTime::createFromFormat(\DateTime::ISO8601, $str); }, $entity->dates); |
|
108 | + $entity->dates = array_map(function($str) { return \DateTime::createFromFormat(\DateTime::ISO8601, $str); }, $entity->dates); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | new EntityNotTypedArray([ |
133 | 133 | 'floats' => $this->randArray('double', self::SCALAR_COUNT), |
134 | 134 | 'booleans' => $this->randArray('boolean', self::SCALAR_COUNT), |
135 | - 'dates' => array_map(function (\DateTime $dateTime) { return $dateTime->format(\DateTime::ISO8601); }, $this->randArray('datetime', self::DATEIME_COUNT)), |
|
135 | + 'dates' => array_map(function(\DateTime $dateTime) { return $dateTime->format(\DateTime::ISO8601); }, $this->randArray('datetime', self::DATEIME_COUNT)), |
|
136 | 136 | ]) |
137 | 137 | ); |
138 | 138 | } |