@@ -146,7 +146,7 @@ |
||
| 146 | 146 | foreach ($sourceAttributes as $key => $attribute) { |
| 147 | 147 | // If the attribute is a proxy, and hasn't be loaded, we discard |
| 148 | 148 | // it from the returned set. |
| 149 | - if ($attribute instanceof ProxyInterface && ! $attribute->isLoaded()) { |
|
| 149 | + if ($attribute instanceof ProxyInterface && !$attribute->isLoaded()) { |
|
| 150 | 150 | continue; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | */ |
| 61 | 61 | public function getEntityAttribute($key) |
| 62 | 62 | { |
| 63 | - if(array_key_exists($key, $this->attributes)) |
|
| 63 | + if (array_key_exists($key, $this->attributes)) |
|
| 64 | 64 | { |
| 65 | 65 | return $this->attributes[$key]; |
| 66 | 66 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | * |
| 209 | 209 | * @var array |
| 210 | 210 | */ |
| 211 | - protected static $singleClasses = ['BelongsTo', 'HasOne', 'MorphOne','MorphTo']; |
|
| 211 | + protected static $singleClasses = ['BelongsTo', 'HasOne', 'MorphOne', 'MorphTo']; |
|
| 212 | 212 | |
| 213 | 213 | /** |
| 214 | 214 | * Relationships with a pivot record |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | public function getTable() |
| 363 | 363 | { |
| 364 | - if (! is_null($this->table)) { |
|
| 364 | + if (!is_null($this->table)) { |
|
| 365 | 365 | return $this->table; |
| 366 | 366 | } |
| 367 | 367 | |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | */ |
| 386 | 386 | public function getSequence() |
| 387 | 387 | { |
| 388 | - if (! is_null($this->sequence)) { |
|
| 388 | + if (!is_null($this->sequence)) { |
|
| 389 | 389 | return $this->sequence; |
| 390 | 390 | } else { |
| 391 | 391 | return $this->getTable().'_id_seq'; |
@@ -944,13 +944,13 @@ discard block |
||
| 944 | 944 | { |
| 945 | 945 | $self = __FUNCTION__; |
| 946 | 946 | |
| 947 | - $caller = array_first(debug_backtrace(false), function ($key, $trace) use ($self) { |
|
| 947 | + $caller = array_first(debug_backtrace(false), function($key, $trace) use ($self) { |
|
| 948 | 948 | $caller = $trace['function']; |
| 949 | 949 | |
| 950 | - return (! in_array($caller, EntityMap::$manyMethods) && $caller != $self); |
|
| 950 | + return (!in_array($caller, EntityMap::$manyMethods) && $caller != $self); |
|
| 951 | 951 | }); |
| 952 | 952 | |
| 953 | - return ! is_null($caller) ? $caller['function'] : null; |
|
| 953 | + return !is_null($caller) ? $caller['function'] : null; |
|
| 954 | 954 | } |
| 955 | 955 | |
| 956 | 956 | /** |
@@ -1153,7 +1153,7 @@ discard block |
||
| 1153 | 1153 | */ |
| 1154 | 1154 | public function __call($method, $parameters) |
| 1155 | 1155 | { |
| 1156 | - if (! array_key_exists($method, $this->dynamicRelationships)) { |
|
| 1156 | + if (!array_key_exists($method, $this->dynamicRelationships)) { |
|
| 1157 | 1157 | throw new Exception(get_class($this)." has no method $method"); |
| 1158 | 1158 | } |
| 1159 | 1159 | |
@@ -254,8 +254,8 @@ |
||
| 254 | 254 | |
| 255 | 255 | $host = $this; |
| 256 | 256 | |
| 257 | - return array_unique(array_values(array_map(function ($value) use ($key, $host) { |
|
| 258 | - if (! $value instanceof InternallyMappable) { |
|
| 257 | + return array_unique(array_values(array_map(function($value) use ($key, $host) { |
|
| 258 | + if (!$value instanceof InternallyMappable) { |
|
| 259 | 259 | $value = $host->factory->make($value); |
| 260 | 260 | } |
| 261 | 261 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public function firstOrFail($columns = array('*')) |
| 184 | 184 | { |
| 185 | - if (! is_null($entity = $this->first($columns))) { |
|
| 185 | + if (!is_null($entity = $this->first($columns))) { |
|
| 186 | 186 | return $entity; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | { |
| 723 | 723 | $fresh = $this->freshTimestamp(); |
| 724 | 724 | |
| 725 | - if (! $exists) { |
|
| 725 | + if (!$exists) { |
|
| 726 | 726 | $record[$this->createdAt()] = $fresh; |
| 727 | 727 | } |
| 728 | 728 | |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | { |
| 736 | 736 | $keyName = $this->relatedMap->getKeyName(); |
| 737 | 737 | |
| 738 | - return array_map(function ($m) use ($keyName) { return $m->$keyName; }, $entities); |
|
| 738 | + return array_map(function($m) use ($keyName) { return $m->$keyName; }, $entities); |
|
| 739 | 739 | } |
| 740 | 740 | |
| 741 | 741 | /** |
@@ -145,7 +145,7 @@ |
||
| 145 | 145 | foreach ($entities as $entity) { |
| 146 | 146 | $entity = $this->factory->make($entity); |
| 147 | 147 | |
| 148 | - if (! is_null($value = $entity->getEntityAttribute($this->foreignKey))) { |
|
| 148 | + if (!is_null($value = $entity->getEntityAttribute($this->foreignKey))) { |
|
| 149 | 149 | $keys[] = $value; |
| 150 | 150 | } |
| 151 | 151 | } |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | { |
| 164 | 164 | $foreign = $this->foreignKey; |
| 165 | 165 | |
| 166 | - return BaseCollection::make($this->dictionary[$type])->map(function ($entities) use ($foreign) { |
|
| 166 | + return BaseCollection::make($this->dictionary[$type])->map(function($entities) use ($foreign) { |
|
| 167 | 167 | return head($entities)->{$foreign}; |
| 168 | 168 | |
| 169 | 169 | })->unique(); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | |
| 37 | 37 | return $this->$method($attribute); |
| 38 | 38 | } |
| 39 | - if (! array_key_exists($key, $this->attributes)) { |
|
| 39 | + if (!array_key_exists($key, $this->attributes)) { |
|
| 40 | 40 | return null; |
| 41 | 41 | } |
| 42 | 42 | if ($this->attributes[$key] instanceof EntityProxy) { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $key = $this->getEntityKey($key); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - return array_first($this->items, function ($itemKey, $entity) use ($key) { |
|
| 43 | + return array_first($this->items, function($itemKey, $entity) use ($key) { |
|
| 44 | 44 | return $this->getEntityKey($entity) == $key; |
| 45 | 45 | }, $default); |
| 46 | 46 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function contains($key, $value = null) |
| 117 | 117 | { |
| 118 | - return ! is_null($this->find($key)); |
|
| 118 | + return !is_null($this->find($key)); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function getEntityHashes() |
| 138 | 138 | { |
| 139 | - return array_map(function ($entity) { |
|
| 139 | + return array_map(function($entity) { |
|
| 140 | 140 | $class = get_class($entity); |
| 141 | 141 | |
| 142 | 142 | $mapper = Manager::getMapper($class); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $dictionary = $this->getDictionary($items); |
| 204 | 204 | |
| 205 | 205 | foreach ($this->items as $item) { |
| 206 | - if (! isset($dictionary[$this->getEntityKey($item)])) { |
|
| 206 | + if (!isset($dictionary[$this->getEntityKey($item)])) { |
|
| 207 | 207 | $diff->add($item); |
| 208 | 208 | } |
| 209 | 209 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | public function max($key = null) |
| 301 | 301 | { |
| 302 | - return $this->reduce(function ($result, $item) use ($key) { |
|
| 302 | + return $this->reduce(function($result, $item) use ($key) { |
|
| 303 | 303 | $wrapper = $this->factory->make($item); |
| 304 | 304 | |
| 305 | 305 | return (is_null($result) || $wrapper->getEntityAttribute($key) > $result) ? |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | */ |
| 316 | 316 | public function min($key = null) |
| 317 | 317 | { |
| 318 | - return $this->reduce(function ($result, $item) use ($key) { |
|
| 318 | + return $this->reduce(function($result, $item) use ($key) { |
|
| 319 | 319 | $wrapper = $this->factory->make($item); |
| 320 | 320 | |
| 321 | 321 | return (is_null($result) || $wrapper->getEntityAttribute($key) < $result) |