@@ -49,7 +49,7 @@ |
||
49 | 49 | $fields = parent::getFillableFields(); |
50 | 50 | $defaults = $this->model->getAttributes(); |
51 | 51 | |
52 | - return $fields->map(function (Field $field, string $key) use ($defaults) { |
|
52 | + return $fields->map(function(Field $field, string $key) use ($defaults) { |
|
53 | 53 | if (in_array($key, array_keys($defaults))) { |
54 | 54 | return $field->nullable(); |
55 | 55 | } |
@@ -39,11 +39,11 @@ |
||
39 | 39 | public function getModelSchemas(): Collection |
40 | 40 | { |
41 | 41 | Utils::invariant( |
42 | - ! empty($this->modelSchemas), |
|
42 | + !empty($this->modelSchemas), |
|
43 | 43 | 'No model schemas defined on "'.get_class($this).'"' |
44 | 44 | ); |
45 | 45 | |
46 | - return collect($this->modelSchemas)->map(function (string $class) { |
|
46 | + return collect($this->modelSchemas)->map(function(string $class) { |
|
47 | 47 | return $this->registry->getModelSchema($class); |
48 | 48 | }); |
49 | 49 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function fields(): array |
20 | 20 | { |
21 | - return $this->getModelSchemas()->reduce(function (array $fields, ModelSchema $modelSchema) { |
|
21 | + return $this->getModelSchemas()->reduce(function(array $fields, ModelSchema $modelSchema) { |
|
22 | 22 | $inputType = 'Create'.$modelSchema->typename().'Input'; |
23 | 23 | |
24 | 24 | $fields[Utils::single($modelSchema->typename())] = $this->registry->field($inputType)->nullable(); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public static function invariant($test, $message = '', ...$args) |
16 | 16 | { |
17 | - if (! $test) { |
|
17 | + if (!$test) { |
|
18 | 18 | if (count($args)) { |
19 | 19 | $message = sprintf($message, $args); |
20 | 20 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | protected function registerRoutes() |
32 | 32 | { |
33 | - if (! config('bakery.path')) { |
|
33 | + if (!config('bakery.path')) { |
|
34 | 34 | return; |
35 | 35 | } |
36 | 36 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | protected function registerBakery() |
77 | 77 | { |
78 | - $this->app->singleton(Bakery::class, function () { |
|
78 | + $this->app->singleton(Bakery::class, function() { |
|
79 | 79 | $bakery = new Bakery(); |
80 | 80 | |
81 | 81 | $this->registerSecurityRules(); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function offsetGet($offset) |
34 | 34 | { |
35 | - if (! $this->offsetExists($offset)) { |
|
35 | + if (!$this->offsetExists($offset)) { |
|
36 | 36 | return null; |
37 | 37 | } |
38 | 38 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | $fields = collect($this->fields); |
31 | 31 | |
32 | - return $fields->map(function (RootField $field) { |
|
32 | + return $fields->map(function(RootField $field) { |
|
33 | 33 | return $field->toArray(); |
34 | 34 | }); |
35 | 35 | } |
@@ -249,7 +249,7 @@ |
||
249 | 249 | { |
250 | 250 | $type = $this->getType($name); |
251 | 251 | |
252 | - if (! $type) { |
|
252 | + if (!$type) { |
|
253 | 253 | throw new TypeNotFound('Type '.$name.' not found.'); |
254 | 254 | } |
255 | 255 |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | $types = $types->merge($this->getPivotModelTypes($schema)); |
199 | 199 | } else { |
200 | 200 | $types->push(new Types\EntityType($this->registry, $schema)) |
201 | - ->push(new Types\EntityLookupType($this->registry, $schema)) |
|
202 | - ->push(new Types\CollectionFilterType($this->registry, $schema)) |
|
203 | - ->push(new Types\CollectionOrderByType($this->registry, $schema)); |
|
201 | + ->push(new Types\EntityLookupType($this->registry, $schema)) |
|
202 | + ->push(new Types\CollectionFilterType($this->registry, $schema)) |
|
203 | + ->push(new Types\CollectionOrderByType($this->registry, $schema)); |
|
204 | 204 | |
205 | 205 | if ($schema->isSearchable()) { |
206 | 206 | $types->push(new Types\CollectionSearchType($this->registry, $schema)); |
@@ -208,12 +208,12 @@ discard block |
||
208 | 208 | |
209 | 209 | if ($schema->isIndexable()) { |
210 | 210 | $types->push(new Types\EntityCollectionType($this->registry, $schema)) |
211 | - ->push(new Types\CollectionRootSearchType($this->registry, $schema)); |
|
211 | + ->push(new Types\CollectionRootSearchType($this->registry, $schema)); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | if ($schema->isMutable()) { |
215 | 215 | $types->push(new Types\CreateInputType($this->registry, $schema)) |
216 | - ->push(new Types\UpdateInputType($this->registry, $schema)); |
|
216 | + ->push(new Types\UpdateInputType($this->registry, $schema)); |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 |
@@ -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 | } |