@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | foreach ($typeFields as $fieldName => $field) { |
| 43 | 43 | $className = get_class($field); |
| 44 | 44 | // We can generate queries for all but Object types, as Object types are relations |
| 45 | - if (! in_array($className, self::$supportedGraphQLTypes)) { |
|
| 45 | + if (!in_array($className, self::$supportedGraphQLTypes)) { |
|
| 46 | 46 | continue; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -97,6 +97,6 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| 100 | - return $allQuery ."\r\n". $paginatedQuery; |
|
| 100 | + return $allQuery . "\r\n" . $paginatedQuery; |
|
| 101 | 101 | } |
| 102 | 102 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | foreach ($typeFields as $fieldName => $field) { |
| 22 | 22 | $config = $field->config; |
| 23 | 23 | |
| 24 | - $required = isset($config['generator-required']) ? ($config['generator-required'] ? '!' : '') : ''; |
|
| 24 | + $required = isset($config['generator-required']) ? ($config['generator-required'] ? '!' : '') : ''; |
|
| 25 | 25 | $className = get_class($field); |
| 26 | 26 | if ($className !== ObjectType::class) { |
| 27 | 27 | continue; |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | $arguments = []; |
| 47 | 47 | foreach ($typeFields as $fieldName => $field) { |
| 48 | 48 | $className = get_class($field); |
| 49 | - if (! in_array($className, self::$supportedGraphQLTypes) || in_array($fieldName, self::$ignoredColumns)) { |
|
| 49 | + if (!in_array($className, self::$supportedGraphQLTypes) || in_array($fieldName, self::$ignoredColumns)) { |
|
| 50 | 50 | continue; |
| 51 | 51 | }; |
| 52 | 52 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function isNotEmpty(): bool |
| 26 | 26 | { |
| 27 | - return (! empty($this->getMutation()) && ! empty($this->getInputType())); |
|
| 27 | + return (!empty($this->getMutation()) && !empty($this->getInputType())); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | */ |
| 119 | 119 | private function indentRows(array $cleared): array |
| 120 | 120 | { |
| 121 | - return array_map(function ($row) { |
|
| 121 | + return array_map(function($row) { |
|
| 122 | 122 | return ' ' . $row; |
| 123 | 123 | }, $cleared); |
| 124 | 124 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function isNotEmpty(): bool |
| 26 | 26 | { |
| 27 | - return (! empty($this->getQueries()) && ! empty($this->getInputType())); |
|
| 27 | + return (!empty($this->getQueries()) && !empty($this->getInputType())); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | ); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if (! file_exists($path)) { |
|
| 131 | + if (!file_exists($path)) { |
|
| 132 | 132 | throw new InvalidConfigurationException( |
| 133 | 133 | sprintf('The "schema_paths" config value for key "%s" contains a path that does not exist', $key) |
| 134 | 134 | ); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | ); |
| 160 | 160 | $relativeTypeImports = $this->generateGraphqlRelativeImports($typeDefinitionPaths); |
| 161 | 161 | |
| 162 | - if (! file_exists($schemaDirectory)) { |
|
| 162 | + if (!file_exists($schemaDirectory)) { |
|
| 163 | 163 | mkdir($schemaDirectory, 0777, true); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -224,14 +224,14 @@ discard block |
||
| 224 | 224 | $j = count($from) - 1; |
| 225 | 225 | // Add '..' until the path is the same |
| 226 | 226 | while ($i <= $j) { |
| 227 | - if (! empty($from[$j])) { |
|
| 227 | + if (!empty($from[$j])) { |
|
| 228 | 228 | $relpath .= '..' . DIRECTORY_SEPARATOR; |
| 229 | 229 | } |
| 230 | 230 | $j--; |
| 231 | 231 | } |
| 232 | 232 | // Go to folder from where it starts differing |
| 233 | 233 | while (isset($to[$i])) { |
| 234 | - if (! empty($to[$i])) { |
|
| 234 | + if (!empty($to[$i])) { |
|
| 235 | 235 | $relpath .= $to[$i] . DIRECTORY_SEPARATOR; |
| 236 | 236 | } |
| 237 | 237 | $i++; |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | * @var ObjectType $type |
| 265 | 265 | */ |
| 266 | 266 | foreach ($schema->getTypeMap() as $typeName => $type) { |
| 267 | - if (! in_array($typeName, $definedTypes) || ! method_exists($type, 'getFields')) { |
|
| 267 | + if (!in_array($typeName, $definedTypes) || !method_exists($type, 'getFields')) { |
|
| 268 | 268 | continue; |
| 269 | 269 | } |
| 270 | 270 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | $graphQLType->config['generator-required'] = true; |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - if (! in_array(get_class($graphQLType), $this->supportedGraphQLTypes)) { |
|
| 288 | + if (!in_array(get_class($graphQLType), $this->supportedGraphQLTypes)) { |
|
| 289 | 289 | continue; |
| 290 | 290 | }; |
| 291 | 291 | |
@@ -318,12 +318,12 @@ discard block |
||
| 318 | 318 | foreach ($definedTypes as $typeName => $type) { |
| 319 | 319 | $paginateAndAllQuery = PaginateAllQueryGenerator::generate($typeName, $type); |
| 320 | 320 | |
| 321 | - if (! empty($paginateAndAllQuery)) { |
|
| 321 | + if (!empty($paginateAndAllQuery)) { |
|
| 322 | 322 | $queries[] = $paginateAndAllQuery; |
| 323 | 323 | } |
| 324 | 324 | $findQuery = FindQueryGenerator::generate($typeName, $type); |
| 325 | 325 | |
| 326 | - if (! empty($findQuery)) { |
|
| 326 | + if (!empty($findQuery)) { |
|
| 327 | 327 | $queries[] = $findQuery; |
| 328 | 328 | } |
| 329 | 329 | |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | $deleteMutation = DeleteMutationGenerator::generate($typeName, $type); |
| 343 | - if (! empty($deleteMutation)) { |
|
| 343 | + if (!empty($deleteMutation)) { |
|
| 344 | 344 | $mutations[] = $deleteMutation; |
| 345 | 345 | } |
| 346 | 346 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function parseValue($value) |
| 31 | 31 | { |
| 32 | - if (! \preg_match(self::PATTERN, $value)) { |
|
| 32 | + if (!\preg_match(self::PATTERN, $value)) { |
|
| 33 | 33 | throw new Error(sprintf('Input error: Expected valid postal code with pattern [1234aa], got: [%s]', $value)); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function parseLiteral($valueNode, array $variables = null) |
| 43 | 43 | { |
| 44 | - if (! $valueNode instanceof StringValueNode) { |
|
| 44 | + if (!$valueNode instanceof StringValueNode) { |
|
| 45 | 45 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, [$valueNode]); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | { |
| 10 | 10 | const CONFIG_PATH = __DIR__ . '/../config/lighthouse-utils.php'; |
| 11 | 11 | const MIGRATION_PATH = __DIR__ . '/../database/migrations/create_graphql_schema_table.php.stub'; |
| 12 | - const DIRECTIVE_PATH = __DIR__.'/Directives'; |
|
| 12 | + const DIRECTIVE_PATH = __DIR__ . '/Directives'; |
|
| 13 | 13 | const DIRECTIVE_NAMESPACE = 'DeInternetJongens\\LighthouseUtils\\Directives'; |
| 14 | 14 | |
| 15 | 15 | |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | self::CONFIG_PATH => config_path('lighthouse-utils.php'), |
| 31 | 31 | ], 'config'); |
| 32 | 32 | |
| 33 | - if (! class_exists('CreatePermissionTables')) { |
|
| 33 | + if (!class_exists('CreatePermissionTables')) { |
|
| 34 | 34 | $timestamp = date('Y_m_d_His', time()); |
| 35 | 35 | $this->publishes([ |
| 36 | - self::MIGRATION_PATH => $this->app->databasePath()."/migrations/{$timestamp}_create_graphql_schema_table.php", |
|
| 36 | + self::MIGRATION_PATH => $this->app->databasePath() . "/migrations/{$timestamp}_create_graphql_schema_table.php", |
|
| 37 | 37 | ], 'migrations'); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | // Merging config doesn't seem to work on arrays, this is our work-around. |
| 52 | 52 | config()->set('lighthouse.directives', array_merge(config('lighthouse.directives', []), [$this->directiveAppPath])); |
| 53 | 53 | |
| 54 | - $this->app->bind('lighthouse-utils', function () { |
|
| 54 | + $this->app->bind('lighthouse-utils', function() { |
|
| 55 | 55 | return new LighthouseUtils(); |
| 56 | 56 | }); |
| 57 | 57 | |