@@ -13,7 +13,7 @@ |
||
| 13 | 13 | protected function getEnvironmentSetUp($app) |
| 14 | 14 | { |
| 15 | 15 | $app['config']->set('database.default', 'testing'); |
| 16 | - $app['router']->get('binary-users/{binaryUser}', function (TestBinaryUserHex $binaryUser) { |
|
| 16 | + $app['router']->get('binary-users/{binaryUser}', function(TestBinaryUserHex $binaryUser) { |
|
| 17 | 17 | return $binaryUser->toJson(); |
| 18 | 18 | })->middleware(SubstituteBindings::class); |
| 19 | 19 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function apply($query) |
| 42 | 42 | { |
| 43 | - $query->where(function ($query) { |
|
| 43 | + $query->where(function($query) { |
|
| 44 | 44 | foreach ($this->ids as $compositeKey) { |
| 45 | 45 | // try to parse normalized key |
| 46 | 46 | if (!is_array($compositeKey)) { |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $queryWriter = function ($query) use ($compositeKey) { |
|
| 59 | + $queryWriter = function($query) use ($compositeKey) { |
|
| 60 | 60 | /* |
| 61 | 61 | * @var \Illuminate\Database\Query\Builder $query |
| 62 | 62 | */ |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | // when combined with an "_id" should conventionally match the columns. |
| 47 | 47 | if (is_null($foreignKey)) { |
| 48 | 48 | $foreignKey = is_array($instance->getKeyName()) ? array_map( |
| 49 | - function ($key) use ($relation) { |
|
| 49 | + function($key) use ($relation) { |
|
| 50 | 50 | return Str::snake($relation).'_'.$key; |
| 51 | 51 | }, |
| 52 | 52 | $instance->getKeyName() |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | protected function newBelongsTo(Builder $query, Model $child, $foreignKey, $ownerKey, $relation) |
| 101 | 101 | { |
| 102 | - return $this->executeWithinOptionalBinaryTransformation(function () use ($query, $child, $foreignKey, $ownerKey, $relation) { |
|
| 102 | + return $this->executeWithinOptionalBinaryTransformation(function() use ($query, $child, $foreignKey, $ownerKey, $relation) { |
|
| 103 | 103 | return new CompositeBelongsTo($query, $child, $foreignKey, $ownerKey, $relation); |
| 104 | 104 | }, $query->getModel(), $child); |
| 105 | 105 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | protected function newHasOne(Builder $query, Model $parent, $foreignKey, $localKey) |
| 118 | 118 | { |
| 119 | - return $this->executeWithinOptionalBinaryTransformation(function () use ($query, $parent, $foreignKey, $localKey) { |
|
| 119 | + return $this->executeWithinOptionalBinaryTransformation(function() use ($query, $parent, $foreignKey, $localKey) { |
|
| 120 | 120 | return new HasOne($query, $parent, $foreignKey, $localKey); |
| 121 | 121 | }, $query->getModel(), $parent); |
| 122 | 122 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | protected function newMorphOne(Builder $query, Model $parent, $type, $id, $localKey) |
| 136 | 136 | { |
| 137 | - return $this->executeWithinOptionalBinaryTransformation(function () use ($query, $parent, $type, $id, $localKey) { |
|
| 137 | + return $this->executeWithinOptionalBinaryTransformation(function() use ($query, $parent, $type, $id, $localKey) { |
|
| 138 | 138 | return new MorphOne($query, $parent, $type, $id, $localKey); |
| 139 | 139 | }, $query->getModel(), $parent); |
| 140 | 140 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | protected function newMorphTo(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation) |
| 155 | 155 | { |
| 156 | - return $this->executeWithinOptionalBinaryTransformation(function () use ($query, $parent, $foreignKey, $ownerKey, $type, $relation) { |
|
| 156 | + return $this->executeWithinOptionalBinaryTransformation(function() use ($query, $parent, $foreignKey, $ownerKey, $type, $relation) { |
|
| 157 | 157 | return new MorphTo($query, $parent, $foreignKey, $ownerKey, $type, $relation); |
| 158 | 158 | }, $query->getModel(), $parent); |
| 159 | 159 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | protected function newHasMany(Builder $query, Model $parent, $foreignKey, $localKey) |
| 172 | 172 | { |
| 173 | - return $this->executeWithinOptionalBinaryTransformation(function () use ($query, $parent, $foreignKey, $localKey) { |
|
| 173 | + return $this->executeWithinOptionalBinaryTransformation(function() use ($query, $parent, $foreignKey, $localKey) { |
|
| 174 | 174 | return new HasMany($query, $parent, $foreignKey, $localKey); |
| 175 | 175 | }, $query->getModel(), $parent); |
| 176 | 176 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) |
| 192 | 192 | { |
| 193 | - return $this->executeWithinOptionalBinaryTransformation(function () use ($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { |
|
| 193 | + return $this->executeWithinOptionalBinaryTransformation(function() use ($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { |
|
| 194 | 194 | return new HasManyThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey); |
| 195 | 195 | }, $query->getModel(), $farParent); |
| 196 | 196 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | protected function newMorphMany(Builder $query, Model $parent, $type, $id, $localKey) |
| 210 | 210 | { |
| 211 | - return $this->executeWithinOptionalBinaryTransformation(function () use ($query, $parent, $type, $id, $localKey) { |
|
| 211 | + return $this->executeWithinOptionalBinaryTransformation(function() use ($query, $parent, $type, $id, $localKey) { |
|
| 212 | 212 | return new MorphMany($query, $parent, $type, $id, $localKey); |
| 213 | 213 | }, $query->getModel(), $parent); |
| 214 | 214 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | protected function newBelongsToMany(Builder $query, Model $parent, $table, $foreignPivotKey, $relatedPivotKey, |
| 231 | 231 | $parentKey, $relatedKey, $relationName = null) |
| 232 | 232 | { |
| 233 | - return $this->executeWithinOptionalBinaryTransformation(function () use ($query, $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName) { |
|
| 233 | + return $this->executeWithinOptionalBinaryTransformation(function() use ($query, $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName) { |
|
| 234 | 234 | return new BelongsToMany($query, $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName); |
| 235 | 235 | }, $query->getModel(), $parent); |
| 236 | 236 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $relatedPivotKey, $parentKey, $relatedKey, |
| 256 | 256 | $relationName = null, $inverse = false) |
| 257 | 257 | { |
| 258 | - return $this->executeWithinOptionalBinaryTransformation(function () use ($query, $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, |
|
| 258 | + return $this->executeWithinOptionalBinaryTransformation(function() use ($query, $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, |
|
| 259 | 259 | $relationName, $inverse) { |
| 260 | 260 | return new MorphToMany($query, $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, |
| 261 | 261 | $relationName, $inverse); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public static function bootHasCompositePrimaryKey() |
| 21 | 21 | { |
| 22 | - static::creating(function ($model) { |
|
| 22 | + static::creating(function($model) { |
|
| 23 | 23 | foreach ($model->getRawKeyName() as $key) { |
| 24 | 24 | if ((!isset($model->{$key}) || empty($model->{$key})) && in_array($key, $model->getBinaryColumns())) { |
| 25 | 25 | $v = uniqid(rand(), true); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } else { |
| 156 | 156 | //remap hex ID to binary ID even if index is not composite |
| 157 | 157 | if ($this->shouldProcessBinaryAttribute($keys[0])) { |
| 158 | - $ids = array_map(function ($hex) use ($keys) { |
|
| 158 | + $ids = array_map(function($hex) use ($keys) { |
|
| 159 | 159 | return $this->recoverBinaryKey($keys[0], $hex); |
| 160 | 160 | }, $ids); |
| 161 | 161 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | return $this->newQueryWithoutScopes()->applyIds( |
| 187 | 187 | array_map( |
| 188 | - function ($normalizedKey) { |
|
| 188 | + function($normalizedKey) { |
|
| 189 | 189 | return $this->parseNormalizedKey($normalizedKey); |
| 190 | 190 | }, |
| 191 | 191 | $ids |