| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | public function generate(): GeneratedCollection | 
| 11 | 11 |      { | 
| 12 | 12 | return new GeneratedCollection( | 
| 13 | - [ new GeneratedItem( | |
| 13 | + [new GeneratedItem( | |
| 14 | 14 | GeneratedItem::TYPE_SEED, | 
| 15 | 15 | $this->generateString(), | 
| 16 | 16 | $this->getGenerateFilename() | 
| @@ -25,6 +25,6 @@ discard block | ||
| 25 | 25 | |
| 26 | 26 | public function getGenerateFilename(): string | 
| 27 | 27 |      { | 
| 28 | -        return $this->getBasePath('database/seeds/'. $this->studlyName . 'Seeder.php'); | |
| 28 | +        return $this->getBasePath('database/seeds/' . $this->studlyName . 'Seeder.php'); | |
| 29 | 29 | } | 
| 30 | 30 | } | 
| @@ -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 | ); | 
| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | public function generate(): GeneratedCollection | 
| 11 | 11 |      { | 
| 12 | 12 | return new GeneratedCollection( | 
| 13 | - [ new GeneratedItem( | |
| 13 | + [new GeneratedItem( | |
| 14 | 14 | GeneratedItem::TYPE_FACTORY, | 
| 15 | 15 | $this->generateString(), | 
| 16 | 16 | $this->getGenerateFilename() | 
| @@ -25,6 +25,6 @@ discard block | ||
| 25 | 25 | |
| 26 | 26 | public function getGenerateFilename(): string | 
| 27 | 27 |      { | 
| 28 | -        return $this->getBasePath('database/factories/'. $this->studlyName . 'Factory.php'); | |
| 28 | +        return $this->getBasePath('database/factories/' . $this->studlyName . 'Factory.php'); | |
| 29 | 29 | } | 
| 30 | 30 | } | 
| @@ -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]; | 
| @@ -105,24 +105,24 @@ | ||
| 105 | 105 | |
| 106 | 106 |          foreach ($directive->arguments as $arg) { | 
| 107 | 107 |              switch ($arg->name->value) { | 
| 108 | - case 'ability': | |
| 109 | - // @phpstan-ignore-next-line | |
| 110 | - $ability = $arg->value->value; | |
| 111 | - break; | |
| 112 | - case 'find': | |
| 113 | - // @phpstan-ignore-next-line | |
| 114 | - $find = $arg->value->value; | |
| 115 | - break; | |
| 116 | - case 'model': | |
| 117 | - // @phpstan-ignore-next-line | |
| 118 | - $model = $arg->value->value; | |
| 119 | - break; | |
| 120 | - case 'injectArgs': | |
| 121 | - $injected = true; | |
| 122 | - break; | |
| 123 | - case 'args': | |
| 124 | - $args = true; | |
| 125 | - break; | |
| 108 | + case 'ability': | |
| 109 | + // @phpstan-ignore-next-line | |
| 110 | + $ability = $arg->value->value; | |
| 111 | + break; | |
| 112 | + case 'find': | |
| 113 | + // @phpstan-ignore-next-line | |
| 114 | + $find = $arg->value->value; | |
| 115 | + break; | |
| 116 | + case 'model': | |
| 117 | + // @phpstan-ignore-next-line | |
| 118 | + $model = $arg->value->value; | |
| 119 | + break; | |
| 120 | + case 'injectArgs': | |
| 121 | + $injected = true; | |
| 122 | + break; | |
| 123 | + case 'args': | |
| 124 | + $args = true; | |
| 125 | + break; | |
| 126 | 126 | } | 
| 127 | 127 | } | 
| 128 | 128 | |
| @@ -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 | } | 
| @@ -74,7 +74,7 @@ discard block | ||
| 74 | 74 | * @param string[] $directiveNamespaces | 
| 75 | 75 | * @return array<string, string> | 
| 76 | 76 | */ | 
| 77 | - public static function getDirectivesGraphql($directiveNamespaces = [ 'Modelarium\Laravel\Lighthouse\Directives' ]): array | |
| 77 | + public static function getDirectivesGraphql($directiveNamespaces = ['Modelarium\Laravel\Lighthouse\Directives']): array | |
| 78 | 78 |      { | 
| 79 | 79 | $directives = []; | 
| 80 | 80 | |
| @@ -84,15 +84,15 @@ discard block | ||
| 84 | 84 | |
| 85 | 85 |              foreach ($classesInNamespace as $class) { | 
| 86 | 86 | $reflection = new \ReflectionClass($class); | 
| 87 | -                if (! $reflection->isInstantiable()) { | |
| 87 | +                if (!$reflection->isInstantiable()) { | |
| 88 | 88 | continue; | 
| 89 | 89 | } | 
| 90 | 90 | |
| 91 | -                if (! is_a($class, \Nuwave\Lighthouse\Schema\Directives\BaseDirective::class, true)) { | |
| 91 | +                if (!is_a($class, \Nuwave\Lighthouse\Schema\Directives\BaseDirective::class, true)) { | |
| 92 | 92 | continue; | 
| 93 | 93 | } | 
| 94 | 94 | |
| 95 | - $name = DirectiveFactory::directiveName((string)$class); | |
| 95 | + $name = DirectiveFactory::directiveName((string) $class); | |
| 96 | 96 | $directives[$name] = trim($class::definition()); | 
| 97 | 97 | } | 
| 98 | 98 | } | 
| @@ -106,7 +106,7 @@ discard block | ||
| 106 | 106 | * @param string[] $directiveNamespaces | 
| 107 | 107 | * @return string | 
| 108 | 108 | */ | 
| 109 | - public static function getDirectivesGraphqlString($directiveNamespaces = [ 'Modelarium\\Laravel\\Lighthouse\\Directives' ]): string | |
| 109 | + public static function getDirectivesGraphqlString($directiveNamespaces = ['Modelarium\\Laravel\\Lighthouse\\Directives']): string | |
| 110 | 110 |      { | 
| 111 | 111 |          return implode("\n\n", self::getDirectivesGraphql($directiveNamespaces)); | 
| 112 | 112 | } | 
| @@ -163,7 +163,7 @@ discard block | ||
| 163 | 163 |                  if ($name === 'Query' || $name === 'Mutation' || $name === 'Subscription' || $name === 'Can') { | 
| 164 | 164 | continue; | 
| 165 | 165 | } | 
| 166 | - $g = $this->processType((string)$name, $object); | |
| 166 | + $g = $this->processType((string) $name, $object); | |
| 167 | 167 | $this->collection = $this->collection->merge($g); | 
| 168 | 168 | } | 
| 169 | 169 | } | 
| @@ -306,7 +306,7 @@ discard block | ||
| 306 | 306 | $name = $directive->name->value; | 
| 307 | 307 |              switch ($name) { | 
| 308 | 308 | case 'migrationSoftDeletes': | 
| 309 | - $this->createCode[] ='$table->softDeletes();'; | |
| 309 | + $this->createCode[] = '$table->softDeletes();'; | |
| 310 | 310 | break; | 
| 311 | 311 | case 'migrationPrimaryIndex': | 
| 312 | 312 | // TODO | 
| @@ -321,10 +321,10 @@ discard block | ||
| 321 | 321 |                  if (!count($indexFields)) { | 
| 322 | 322 |                      throw new Exception("You must provide at least one field to an index"); | 
| 323 | 323 | } | 
| 324 | -                $this->createCode[] ='$table->index("' . implode('", "', $indexFields) .'");'; | |
| 324 | +                $this->createCode[] = '$table->index("' . implode('", "', $indexFields) . '");'; | |
| 325 | 325 | break; | 
| 326 | 326 | case 'migrationSpatialIndex': | 
| 327 | -                $this->createCode[] ='$table->spatialIndex("' . $directive->arguments[0]->value->value .'");'; | |
| 327 | +                $this->createCode[] = '$table->spatialIndex("' . $directive->arguments[0]->value->value . '");'; | |
| 328 | 328 | break; | 
| 329 | 329 | |
| 330 | 330 | case 'migrationFulltextIndex': | 
| @@ -345,10 +345,10 @@ discard block | ||
| 345 | 345 | "\")');"; | 
| 346 | 346 | break; | 
| 347 | 347 | case 'migrationRememberToken': | 
| 348 | - $this->createCode[] ='$table->rememberToken();'; | |
| 348 | + $this->createCode[] = '$table->rememberToken();'; | |
| 349 | 349 | break; | 
| 350 | 350 | case 'migrationTimestamps': | 
| 351 | - $this->createCode[] ='$table->timestamps();'; | |
| 351 | + $this->createCode[] = '$table->timestamps();'; | |
| 352 | 352 | break; | 
| 353 | 353 | default: | 
| 354 | 354 | } | 
| @@ -81,7 +81,7 @@ discard block | ||
| 81 | 81 | $writtenFiles = $this->writeFiles( | 
| 82 | 82 | $collection, | 
| 83 | 83 | $basepath, | 
| 84 | -            (bool)$this->option('overwrite') | |
| 84 | +            (bool) $this->option('overwrite') | |
| 85 | 85 | ); | 
| 86 | 86 |          $this->info('Files generated.'); | 
| 87 | 87 | |
| @@ -97,7 +97,7 @@ discard block | ||
| 97 | 97 | // this runs all prettier commands in parallel. | 
| 98 | 98 | $run = array_reduce( | 
| 99 | 99 | $writtenFiles, | 
| 100 | -                function ($carry, $f) use ($command) { | |
| 100 | +                function($carry, $f) use ($command) { | |
| 101 | 101 |                      return $carry . '(' . $command . $f . ') & '; | 
| 102 | 102 | } | 
| 103 | 103 | ); |