@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $tables = [$tables]; |
88 | 88 | } |
89 | 89 | |
90 | - $tables = array_map(function ($table) { |
|
90 | + $tables = array_map(function($table) { |
|
91 | 91 | if ($table instanceof TableInterface) { |
92 | 92 | return (new TableTransformer($table, $this->platform))->toDoctrine(); |
93 | 93 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $queries = $queries->toSql($this->platform->grammar()); |
236 | 236 | } |
237 | 237 | |
238 | - foreach ((array)$queries as $query) { |
|
238 | + foreach ((array) $queries as $query) { |
|
239 | 239 | $this->queries[] = $query; |
240 | 240 | } |
241 | 241 |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | return $this->get($type)->toDatabase($value); |
155 | 155 | } |
156 | 156 | |
157 | - throw new TypeException(gettype($value), 'Cannot convert to database the value : ' . print_r($value, true).PHP_EOL.'You should set a valid type as second parameter'); |
|
157 | + throw new TypeException(gettype($value), 'Cannot convert to database the value : '.print_r($value, true).PHP_EOL.'You should set a valid type as second parameter'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | return null; |
177 | 177 | } |
178 | 178 | |
179 | - throw new TypeException(gettype($value), 'Cannot convert to php the value : ' . print_r($value, true).PHP_EOL.'You should set a valid type as second parameter'); |
|
179 | + throw new TypeException(gettype($value), 'Cannot convert to php the value : '.print_r($value, true).PHP_EOL.'You should set a valid type as second parameter'); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -327,7 +327,7 @@ |
||
327 | 327 | return $items->all(); |
328 | 328 | } |
329 | 329 | |
330 | - return (array)$items; |
|
330 | + return (array) $items; |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function load($relations) |
65 | 65 | { |
66 | - foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) { |
|
66 | + foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) { |
|
67 | 67 | $this->repository->relation($relationName)->load( |
68 | 68 | EntityIndexer::fromArray($this->repository->mapper(), $this->storage->all()), |
69 | 69 | $meta['relations'], |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function delete() |
128 | 128 | { |
129 | - $this->repository->transaction(function (RepositoryInterface $repository) { |
|
129 | + $this->repository->transaction(function(RepositoryInterface $repository) { |
|
130 | 130 | $writer = new BufferedWriter($repository); |
131 | 131 | |
132 | 132 | foreach ($this as $entity) { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function save() |
148 | 148 | { |
149 | - $this->repository->transaction(function (RepositoryInterface $repository) { |
|
149 | + $this->repository->transaction(function(RepositoryInterface $repository) { |
|
150 | 150 | foreach ($this as $entity) { |
151 | 151 | $repository->save($entity); |
152 | 152 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function saveAll($relations) |
167 | 167 | { |
168 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
168 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
169 | 169 | |
170 | 170 | return $this->repository->transaction(function(RepositoryInterface $repository) use($relations) { |
171 | 171 | $nb = 0; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function deleteAll($relations) |
194 | 194 | { |
195 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
195 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
196 | 196 | |
197 | 197 | return $this->repository->transaction(function(RepositoryInterface $repository) use($relations) { |
198 | 198 | $nb = 0; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function resolve($entityClass) |
27 | 27 | { |
28 | - return $entityClass . $this->suffix; |
|
28 | + return $entityClass.$this->suffix; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function setReadOnly($flag) |
224 | 224 | { |
225 | - $this->readOnly = (bool)$flag; |
|
225 | + $this->readOnly = (bool) $flag; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | */ |
261 | 261 | public function setQuoteIdentifier($flag) |
262 | 262 | { |
263 | - $this->useQuoteIdentifier = (bool)$flag; |
|
263 | + $this->useQuoteIdentifier = (bool) $flag; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | /** |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | public function setGenerator($generator) |
282 | 282 | { |
283 | 283 | if (!is_string($generator) && !$generator instanceof GeneratorInterface) { |
284 | - throw new LogicException('Trying to set an invalid generator in "' . get_class($this) . '"'); |
|
284 | + throw new LogicException('Trying to set an invalid generator in "'.get_class($this).'"'); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | $this->generator = $generator; |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | $relations = $this->relations(); |
516 | 516 | |
517 | 517 | if (!isset($relations[$relationName])) { |
518 | - throw new RelationNotFoundException('Relation "' . $relationName . '" is not set in ' . $this->metadata->entityName); |
|
518 | + throw new RelationNotFoundException('Relation "'.$relationName.'" is not set in '.$this->metadata->entityName); |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | return $relations[$relationName]; |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | */ |
690 | 690 | public function scopes() |
691 | 691 | { |
692 | - throw new LogicException('No scopes have been defined in "' . get_class($this) . '"'); |
|
692 | + throw new LogicException('No scopes have been defined in "'.get_class($this).'"'); |
|
693 | 693 | } |
694 | 694 | |
695 | 695 | /** |
@@ -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', |