@@ -9,7 +9,7 @@ |
||
| 9 | 9 | public function filterByType(string $type): GeneratedCollection |
| 10 | 10 | { |
| 11 | 11 | return $this->filter( |
| 12 | - function ($i) use ($type) { |
|
| 12 | + function($i) use ($type) { |
|
| 13 | 13 | return $i->type == $type; |
| 14 | 14 | } |
| 15 | 15 | ); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | { |
| 160 | 160 | $originalTypeLoader = $this->schema->getConfig()->typeLoader; |
| 161 | 161 | |
| 162 | - $this->schema->getConfig()->typeLoader = function ($typeName) use ($originalTypeLoader) { |
|
| 162 | + $this->schema->getConfig()->typeLoader = function($typeName) use ($originalTypeLoader) { |
|
| 163 | 163 | $type = $originalTypeLoader($typeName); |
| 164 | 164 | if ($type instanceof \GraphQL\Type\Definition\CustomScalarType) { |
| 165 | 165 | $scalarName = $type->name; |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | $this->ast = Visitor::visit($this->ast, [ |
| 176 | 176 | // load the scalar type classes |
| 177 | - NodeKind::SCALAR_TYPE_DEFINITION => function ($node) { |
|
| 177 | + NodeKind::SCALAR_TYPE_DEFINITION => function($node) { |
|
| 178 | 178 | $scalarName = $node->name->value; |
| 179 | 179 | |
| 180 | 180 | // load classes |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | return []; |
| 238 | 238 | } |
| 239 | 239 | return array_map( |
| 240 | - function ($i) use ($basedir) { |
|
| 240 | + function($i) use ($basedir) { |
|
| 241 | 241 | $name = $i[1]; |
| 242 | 242 | if (array_key_exists($name, $this->imports)) { |
| 243 | 243 | return $this->imports[$name]; |
@@ -168,6 +168,6 @@ |
||
| 168 | 168 | |
| 169 | 169 | public function getGenerateFilename(string $name): string |
| 170 | 170 | { |
| 171 | - return $this->getBasePath('app/Policies/'. Str::studly($name) . 'Policy.php'); |
|
| 171 | + return $this->getBasePath('app/Policies/' . Str::studly($name) . 'Policy.php'); |
|
| 172 | 172 | } |
| 173 | 173 | } |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | throw new Exception("Directive $validator does not have argument $argName"); |
| 107 | 107 | } |
| 108 | 108 | if ($argValidator->type === 'Int') { |
| 109 | - $argValue = (int)$argValue; |
|
| 109 | + $argValue = (int) $argValue; |
|
| 110 | 110 | } |
| 111 | 111 | $arguments[$argName] = $argValue; |
| 112 | 112 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | $target = base_path('graphql/data/' . $this->lowerName . '.graphql'); |
| 70 | 70 | $this->writeFile( |
| 71 | 71 | $target, |
| 72 | - (bool)$this->option('overwrite'), |
|
| 72 | + (bool) $this->option('overwrite'), |
|
| 73 | 73 | $graphql |
| 74 | 74 | ); |
| 75 | 75 | $this->info('Type generated at ' . $target); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | public static function scalars(array $datatypes, string $ns): array |
| 48 | 48 | { |
| 49 | - $graphql = [ '# File automatically generated by Modelarium on ' . date('c') . "\n\n" ]; |
|
| 49 | + $graphql = ['# File automatically generated by Modelarium on ' . date('c') . "\n\n"]; |
|
| 50 | 50 | |
| 51 | 51 | foreach ($datatypes as $name) { |
| 52 | 52 | $typeName = Str::studly($name); |
@@ -45,13 +45,13 @@ |
||
| 45 | 45 | |
| 46 | 46 | Event::listen( |
| 47 | 47 | RegisterDirectiveNamespaces::class, |
| 48 | - function (RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
| 48 | + function(RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
| 49 | 49 | return 'Modelarium\\Laravel\\Lighthouse\\Directives'; |
| 50 | 50 | } |
| 51 | 51 | ); |
| 52 | 52 | Event::listen( |
| 53 | 53 | RegisterDirectiveNamespaces::class, |
| 54 | - function (RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
| 54 | + function(RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
| 55 | 55 | return 'App\\Datatypes\\Types'; |
| 56 | 56 | } |
| 57 | 57 | ); |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $previousResolver = $fieldValue->getResolver(); |
| 44 | 44 | |
| 45 | 45 | // Wrap around the resolver |
| 46 | - $wrappedResolver = function ($root, array $args, GraphQLContext $context, ResolveInfo $info) use ($previousResolver): string { |
|
| 46 | + $wrappedResolver = function($root, array $args, GraphQLContext $context, ResolveInfo $info) use ($previousResolver): string { |
|
| 47 | 47 | // Call the resolver, passing along the resolver arguments |
| 48 | 48 | /** @var string $result */ |
| 49 | 49 | $result = $previousResolver($root, $args, $context, $info); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | /** |
| 32 | 32 | * @var string |
| 33 | 33 | */ |
| 34 | - protected $targetClass= ''; |
|
| 34 | + protected $targetClass = ''; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * If false, $source is "User" (class with HasOne/HasMany posts()) |