@@ -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 | */ |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public static function bootHasCompositePrimaryKey() |
| 23 | 23 | { |
| 24 | - static::creating(function ($model) { |
|
| 24 | + static::creating(function($model) { |
|
| 25 | 25 | foreach ($model->getRawKeyName() as $key) { |
| 26 | 26 | if (!isset($model->{$key}) && in_array($key, $model->getBinaryColumns())) { |
| 27 | 27 | $v = uniqid(rand(), true); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } else { |
| 158 | 158 | //remap hex ID to binary ID even if index is not composite |
| 159 | 159 | if ($this->shouldProcessBinaryAttribute($keys[0])) { |
| 160 | - $ids = array_map(function ($hex) { |
|
| 160 | + $ids = array_map(function($hex) { |
|
| 161 | 161 | return hex2bin($hex); |
| 162 | 162 | }, $ids); |
| 163 | 163 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | return $this->newQueryWithoutScopes()->applyIds( |
| 189 | 189 | array_map( |
| 190 | - function ($normalizedKey) { |
|
| 190 | + function($normalizedKey) { |
|
| 191 | 191 | return $this->parseNormalizedKey($normalizedKey); |
| 192 | 192 | }, |
| 193 | 193 | $ids |
@@ -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() |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | return $relationQuery; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - protected function executeWithinOptionalBinaryTransformation(Closure $relation, ...$models){ |
|
| 72 | + protected function executeWithinOptionalBinaryTransformation(Closure $relation, ...$models) { |
|
| 73 | 73 | foreach ($models as $model) { |
| 74 | 74 | if (method_exists($model, 'disableBinaryMutators')) { |
| 75 | 75 | $model->disableBinaryMutators(); |
@@ -16,15 +16,15 @@ |
||
| 16 | 16 | return $this->hexBinaryColumns; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - public function disableBinaryMutators(){ |
|
| 19 | + public function disableBinaryMutators() { |
|
| 20 | 20 | $this->shouldMutate = false; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function enableBinaryMutators(){ |
|
| 23 | + public function enableBinaryMutators() { |
|
| 24 | 24 | $this->shouldMutate = true; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - protected function isAllowedToMutatateBinaryAttributes(){ |
|
| 27 | + protected function isAllowedToMutatateBinaryAttributes() { |
|
| 28 | 28 | return $this->shouldMutate; |
| 29 | 29 | } |
| 30 | 30 | |