@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $mapper->entityClass = $mapperConfig->entityClass; |
137 | 137 | } |
138 | 138 | |
139 | - if ($mapperConfig->behaviours && ! empty($mapperConfig->behaviours)) { |
|
139 | + if ($mapperConfig->behaviours && !empty($mapperConfig->behaviours)) { |
|
140 | 140 | $mapper->use(...$mapperConfig->behaviours); |
141 | 141 | } |
142 | 142 | |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | public function __construct(Orm $orm, FactoryInterface $entityFactory = null, QueryBuilder $queryBuilder = null) |
147 | 147 | { |
148 | 148 | $this->orm = $orm; |
149 | - if (! $entityFactory) { |
|
149 | + if (!$entityFactory) { |
|
150 | 150 | $entityFactory = new GenericEntityFactory($orm, $this); |
151 | 151 | } |
152 | - if (! $queryBuilder) { |
|
152 | + if (!$queryBuilder) { |
|
153 | 153 | $this->queryBuilder = QueryBuilder::getInstance(); |
154 | 154 | } |
155 | 155 | $this->entityFactory = $entityFactory; |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $mapper = $this; |
221 | 221 | |
222 | 222 | $singular = Inflector::singularize($this->getTableAlias(true)); |
223 | - $castingManager->register($singular, function ($value) use ($mapper, $castingManager) { |
|
223 | + $castingManager->register($singular, function($value) use ($mapper, $castingManager) { |
|
224 | 224 | if ($value instanceof $this->entityClass) { |
225 | 225 | return $value; |
226 | 226 | } |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | }); |
229 | 229 | |
230 | 230 | $plural = $this->getTableAlias(true); |
231 | - $castingManager->register($plural, function ($values) use ($mapper, $castingManager) { |
|
231 | + $castingManager->register($plural, function($values) use ($mapper, $castingManager) { |
|
232 | 232 | if ($values instanceof Collection) { |
233 | 233 | return $values; |
234 | 234 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function getTableAlias($returnTableIfNull = false) |
264 | 264 | { |
265 | - return (! $this->tableAlias && $returnTableIfNull) ? $this->table : $this->tableAlias; |
|
265 | + return (!$this->tableAlias && $returnTableIfNull) ? $this->table : $this->tableAlias; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | public function getTableReference() |
@@ -327,8 +327,8 @@ discard block |
||
327 | 327 | return null; |
328 | 328 | } |
329 | 329 | |
330 | - $receivedTracker = ! ! $tracker; |
|
331 | - if (! $tracker) { |
|
330 | + $receivedTracker = !!$tracker; |
|
331 | + if (!$tracker) { |
|
332 | 332 | $receivedTracker = false; |
333 | 333 | $tracker = new Tracker($this, [$data]); |
334 | 334 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $this->injectRelations($entity, $tracker, $load); |
338 | 338 | $entity->setPersistanceState(StateEnum::SYNCHRONIZED); |
339 | 339 | |
340 | - if (! $receivedTracker) { |
|
340 | + if (!$receivedTracker) { |
|
341 | 341 | $tracker->replaceRows([$entity]); |
342 | 342 | if ($tracker->isDisposable()) { |
343 | 343 | unset($tracker); |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | $queryCallback = $eagerLoad[$name] ?? null; |
393 | 393 | $nextLoad = Arr::getChildren($eagerLoad, $name); |
394 | 394 | |
395 | - if (! $tracker->hasRelation($name)) { |
|
395 | + if (!$tracker->hasRelation($name)) { |
|
396 | 396 | $tracker->setRelation($name, $relation, $queryCallback); |
397 | 397 | } |
398 | 398 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | |
430 | 430 | public function getRelation($name): Relation |
431 | 431 | { |
432 | - if (! $this->hasRelation($name)) { |
|
432 | + if (!$this->hasRelation($name)) { |
|
433 | 433 | throw new \InvalidArgumentException("Relation named {$name} is not registered for this mapper"); |
434 | 434 | } |
435 | 435 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | $this->relations[$name] = $this->orm->createRelation($this, $name, $this->relations[$name]); |
438 | 438 | } |
439 | 439 | $relation = $this->relations[$name]; |
440 | - if (! $relation instanceof Relation) { |
|
440 | + if (!$relation instanceof Relation) { |
|
441 | 441 | throw new \InvalidArgumentException("Relation named {$name} is not a proper Relation instance"); |
442 | 442 | } |
443 | 443 | |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | |
481 | 481 | public function newSaveAction(EntityInterface $entity, $options): BaseAction |
482 | 482 | { |
483 | - if (! $entity->getPk()) { |
|
483 | + if (!$entity->getPk()) { |
|
484 | 484 | $action = new Insert($this, $entity, $options); |
485 | 485 | } else { |
486 | 486 | $action = new Update($this, $entity, $options); |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | |
508 | 508 | protected function assertCanPersistEntity($entity) |
509 | 509 | { |
510 | - if (! $entity || ! $entity instanceof $this->entityClass) { |
|
510 | + if (!$entity || !$entity instanceof $this->entityClass) { |
|
511 | 511 | throw new \InvalidArgumentException(sprintf( |
512 | 512 | 'Mapper %s can only persist entity of class %s. %s class provided', |
513 | 513 | __CLASS__, |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | public function register($name, callable $func) |
11 | 11 | { |
12 | - if ( ! $name) { |
|
12 | + if (!$name) { |
|
13 | 13 | return; // ignore |
14 | 14 | } |
15 | 15 | $this->casts[$name] = $func; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | public function bool($value) |
45 | 45 | { |
46 | - return ! ! $value; |
|
46 | + return !!$value; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public function int($value) |