@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $key = $this->getEntityKey($key); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - return array_first($this->items, function ($itemKey, $entity) use ($key) { |
|
| 45 | + return array_first($this->items, function($itemKey, $entity) use ($key) { |
|
| 46 | 46 | return $this->getEntityKey($entity) == $key; |
| 47 | 47 | }, $default); |
| 48 | 48 | } |
@@ -144,14 +144,14 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function getEntityHashes() |
| 146 | 146 | { |
| 147 | - return array_map(function ($entity) { |
|
| 147 | + return array_map(function($entity) { |
|
| 148 | 148 | $class = get_class($entity); |
| 149 | 149 | |
| 150 | 150 | $mapper = Manager::getMapper($class); |
| 151 | 151 | |
| 152 | 152 | $keyName = $mapper->getEntityMap()->getKeyName(); |
| 153 | 153 | |
| 154 | - return $class . '.' . $entity->getEntityAttribute($keyName); |
|
| 154 | + return $class.'.'.$entity->getEntityAttribute($keyName); |
|
| 155 | 155 | }, |
| 156 | 156 | $this->items); |
| 157 | 157 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | $keyName = $mapper->getEntityMap()->getKeyName(); |
| 176 | 176 | |
| 177 | - if (in_array($class . '.' . $item->$keyName, $hashes)) { |
|
| 177 | + if (in_array($class.'.'.$item->$keyName, $hashes)) { |
|
| 178 | 178 | $subset[] = $item; |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | public function max($key = null) |
| 323 | 323 | { |
| 324 | - return $this->reduce(function ($result, $item) use ($key) { |
|
| 324 | + return $this->reduce(function($result, $item) use ($key) { |
|
| 325 | 325 | $wrapper = $this->factory->make($item); |
| 326 | 326 | |
| 327 | 327 | return (is_null($result) || $wrapper->getEntityAttribute($key) > $result) ? |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | */ |
| 339 | 339 | public function min($key = null) |
| 340 | 340 | { |
| 341 | - return $this->reduce(function ($result, $item) use ($key) { |
|
| 341 | + return $this->reduce(function($result, $item) use ($key) { |
|
| 342 | 342 | $wrapper = $this->factory->make($item); |
| 343 | 343 | |
| 344 | 344 | return (is_null($result) || $wrapper->getEntityAttribute($key) < $result) |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | throw new InvalidArgumentException('Fired Event with invalid Entity Object'); |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | - $event = "analogue.{$event}." . $this->entityMap->getClass(); |
|
| 262 | + $event = "analogue.{$event}.".$this->entityMap->getClass(); |
|
| 263 | 263 | |
| 264 | 264 | $method = $halt ? 'until' : 'fire'; |
| 265 | 265 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | public function getGlobalScope($scope) |
| 312 | 312 | { |
| 313 | - return array_first($this->globalScopes, function ($key, $value) use ($scope) { |
|
| 313 | + return array_first($this->globalScopes, function($key, $value) use ($scope) { |
|
| 314 | 314 | return $scope instanceof $value; |
| 315 | 315 | }); |
| 316 | 316 | } |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | $count = new Expression($count); |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | - return $this->where(new Expression('(' . $hasQuery->toSql() . ')'), $operator, $count, $boolean); |
|
| 469 | + return $this->where(new Expression('('.$hasQuery->toSql().')'), $operator, $count, $boolean); |
|
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | /** |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | */ |
| 500 | 500 | protected function getHasRelationQuery($relation, $entity) |
| 501 | 501 | { |
| 502 | - return Relationship::noConstraints(function () use ($relation, $entity) { |
|
| 502 | + return Relationship::noConstraints(function() use ($relation, $entity) { |
|
| 503 | 503 | return $this->entityMap->$relation($entity); |
| 504 | 504 | }); |
| 505 | 505 | } |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | // constraints have been specified for the eager load and we'll just put |
| 549 | 549 | // an empty Closure with the loader so that we can treat all the same. |
| 550 | 550 | if (is_numeric($name)) { |
| 551 | - $f = function () {}; |
|
| 551 | + $f = function() {}; |
|
| 552 | 552 | |
| 553 | 553 | list($name, $constraints) = [$constraints, $f]; |
| 554 | 554 | } |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | $progress[] = $segment; |
| 584 | 584 | |
| 585 | 585 | if (!isset($results[$last = implode('.', $progress)])) { |
| 586 | - $results[$last] = function () {}; |
|
| 586 | + $results[$last] = function() {}; |
|
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | // We want to run a relationship query without any constrains so that we will |
| 673 | 673 | // not have to remove these where clauses manually which gets really hacky |
| 674 | 674 | // and is error prone while we remove the developer's own where clauses. |
| 675 | - $query = Relationship::noConstraints(function () use ($relation) { |
|
| 675 | + $query = Relationship::noConstraints(function() use ($relation) { |
|
| 676 | 676 | return $this->entityMap->$relation($this->getEntityInstance()); |
| 677 | 677 | }); |
| 678 | 678 | |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | // that start with the given top relations and adds them to our arrays. |
| 704 | 704 | foreach ($this->eagerLoad as $name => $constraints) { |
| 705 | 705 | if ($this->isNested($name, $relation)) { |
| 706 | - $nested[substr($name, strlen($relation . '.'))] = $constraints; |
|
| 706 | + $nested[substr($name, strlen($relation.'.'))] = $constraints; |
|
| 707 | 707 | } |
| 708 | 708 | } |
| 709 | 709 | |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | { |
| 722 | 722 | $dots = str_contains($name, '.'); |
| 723 | 723 | |
| 724 | - return $dots && starts_with($name, $relation . '.'); |
|
| 724 | + return $dots && starts_with($name, $relation.'.'); |
|
| 725 | 725 | } |
| 726 | 726 | |
| 727 | 727 | /** |