@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | protected function getModelTypes(): Collection |
193 | 193 | { |
194 | - return $this->getModels()->reduce(function (Collection $types, string $class) { |
|
194 | + return $this->getModels()->reduce(function(Collection $types, string $class) { |
|
195 | 195 | $schema = $this->registry->getModelSchema($class); |
196 | 196 | |
197 | 197 | if ($schema->getModel() instanceof Pivot) { |
@@ -218,26 +218,26 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | // Filter through the regular fields and get the polymorphic types. |
221 | - $schema->getFields()->filter(function ($field) { |
|
221 | + $schema->getFields()->filter(function($field) { |
|
222 | 222 | return $field instanceof PolymorphicField; |
223 | - })->each(function ($field, $key) use ($schema, &$types) { |
|
223 | + })->each(function($field, $key) use ($schema, &$types) { |
|
224 | 224 | $types = $types->merge($this->getPolymorphicFieldTypes($schema, $key, $field)); |
225 | 225 | }); |
226 | 226 | |
227 | 227 | // Filter through the relations of the model and get the |
228 | 228 | // belongsToMany relations and get the pivot input types |
229 | 229 | // for that relation. |
230 | - $schema->getRelations()->filter(function ($relation) { |
|
230 | + $schema->getRelations()->filter(function($relation) { |
|
231 | 231 | return $relation instanceof BelongsToMany; |
232 | - })->each(function ($relation) use (&$types) { |
|
232 | + })->each(function($relation) use (&$types) { |
|
233 | 233 | $types = $types->merge($this->getPivotInputTypes($relation)); |
234 | 234 | }); |
235 | 235 | |
236 | 236 | // Filter through the relation fields and get the the |
237 | 237 | // polymorphic types for the relations. |
238 | - $schema->getRelationFields()->filter(function ($field) { |
|
238 | + $schema->getRelationFields()->filter(function($field) { |
|
239 | 239 | return $field instanceof PolymorphicField; |
240 | - })->each(function ($field, $key) use ($schema, &$types) { |
|
240 | + })->each(function($field, $key) use ($schema, &$types) { |
|
241 | 241 | $types = $types->merge($this->getPolymorphicRelationshipTypes($schema, $key, $field)); |
242 | 242 | }); |
243 | 243 | |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | foreach ($this->getModels() as $modelSchema) { |
366 | 366 | $modelSchema = $this->registry->getModelSchema($modelSchema); |
367 | 367 | |
368 | - if (! $modelSchema->getModel() instanceof Pivot) { |
|
368 | + if (!$modelSchema->getModel() instanceof Pivot) { |
|
369 | 369 | $entityQuery = new SingleEntityQuery($this->registry, $modelSchema); |
370 | 370 | $queries->put($entityQuery->getName(), $entityQuery); |
371 | 371 | |
@@ -410,11 +410,11 @@ discard block |
||
410 | 410 | foreach ($this->getModels() as $class) { |
411 | 411 | $modelSchema = $this->registry->getModelSchema($class); |
412 | 412 | |
413 | - $pivotRelations = $modelSchema->getRelations()->filter(function ($relation) { |
|
413 | + $pivotRelations = $modelSchema->getRelations()->filter(function($relation) { |
|
414 | 414 | return $relation instanceof BelongsToMany; |
415 | 415 | }); |
416 | 416 | |
417 | - if ($modelSchema->isMutable() && ! $modelSchema->getModel() instanceof Pivot) { |
|
417 | + if ($modelSchema->isMutable() && !$modelSchema->getModel() instanceof Pivot) { |
|
418 | 418 | $createMutation = new CreateMutation($this->registry, $modelSchema); |
419 | 419 | $mutations->put($createMutation->getName(), $createMutation); |
420 | 420 | |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | $config->setDirectives(array_merge(Directive::getInternalDirectives(), $this->directives())); |
516 | 516 | |
517 | 517 | // Set the type loader |
518 | - $config->setTypeLoader(function ($name) use ($query, $mutation) { |
|
518 | + $config->setTypeLoader(function($name) use ($query, $mutation) { |
|
519 | 519 | if ($name === $query->name) { |
520 | 520 | return $query; |
521 | 521 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $type = $this->registry->ID()->list(); |
57 | 57 | } |
58 | 58 | |
59 | - return $this->modelSchema->getLookupFields()->map(function (Field $field) { |
|
59 | + return $this->modelSchema->getLookupFields()->map(function(Field $field) { |
|
60 | 60 | return $field->getType(); |
61 | 61 | })->merge(['input' => $type])->toArray(); |
62 | 62 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $pivotAccessor = $relation->getPivotAccessor(); |
78 | 78 | $pivotSchema = $this->getPivotModelSchema(); |
79 | 79 | |
80 | - $input->map(function ($input) use ($pivotSchema, $relation, $pivotAccessor, $model) { |
|
80 | + $input->map(function($input) use ($pivotSchema, $relation, $pivotAccessor, $model) { |
|
81 | 81 | $key = $input[$model->getKeyName()] ?? $input; |
82 | 82 | $pivotWhere = $input[$pivotAccessor] ?? []; |
83 | 83 | |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | $query->wherePivot($relation->getRelatedPivotKeyName(), $key); |
96 | 96 | |
97 | 97 | return $query; |
98 | - })->map(function (Relations\BelongsToMany $query) use ($modelSchema) { |
|
99 | - $query->each(function (Model $related) use ($modelSchema) { |
|
98 | + })->map(function(Relations\BelongsToMany $query) use ($modelSchema) { |
|
99 | + $query->each(function(Model $related) use ($modelSchema) { |
|
100 | 100 | $modelSchema->authorizeToDetach($related); |
101 | 101 | }); |
102 | 102 | |
103 | 103 | return $query; |
104 | - })->each(function (Relations\BelongsToMany $query) { |
|
104 | + })->each(function(Relations\BelongsToMany $query) { |
|
105 | 105 | $query->detach(); |
106 | 106 | }); |
107 | 107 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | if (is_null($model)) { |
43 | 43 | $model = $this->rootNamespace().$this->argument('name'); |
44 | - } elseif (! Str::startsWith($model, [$this->rootNamespace(), '\\'])) { |
|
44 | + } elseif (!Str::startsWith($model, [$this->rootNamespace(), '\\'])) { |
|
45 | 45 | $model = $this->rootNamespace().$model; |
46 | 46 | } |
47 | 47 |