@@ -8,7 +8,6 @@ |
||
8 | 8 | |
9 | 9 | namespace App\GraphQL\Feature\Paginator; |
10 | 10 | |
11 | -use GraphQL\Type\Definition\Type; |
|
12 | 11 | use Illuminate\Support\Collection; |
13 | 12 | use Illuminate\Database\Eloquent\Builder; |
14 | 13 | use App\GraphQL\Serializers\RawSerializer; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * For the full copyright and license information, please view the LICENSE |
5 | 5 | * file that was distributed with this source code. |
6 | 6 | */ |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace App\GraphQL\Feature\Paginator; |
10 | 10 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @param string $alias |
83 | 83 | * @return PaginatorConfiguration |
84 | 84 | */ |
85 | - public static function find(string $alias): ?PaginatorConfiguration |
|
85 | + public static function find(string $alias): ? PaginatorConfiguration |
|
86 | 86 | { |
87 | 87 | foreach (self::$configs as $config) { |
88 | 88 | if ($config->getAlias() === $alias) { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function getPages(): int |
116 | 116 | { |
117 | - return (int)ceil($this->count / $this->getLimit()); |
|
117 | + return (int) ceil($this->count / $this->getLimit()); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function getSkip(): int |
164 | 164 | { |
165 | - return (int)($this->page - 1) * $this->limit; |
|
165 | + return (int) ($this->page - 1) * $this->limit; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * @param null|string $serializer |
207 | 207 | * @return $this|PaginatorConfiguration |
208 | 208 | */ |
209 | - public function use(?string $serializer): PaginatorConfiguration |
|
209 | + public function use(? string $serializer) : PaginatorConfiguration |
|
210 | 210 | { |
211 | 211 | $this->serializer = $serializer; |
212 | 212 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $query = clone $this->query; |
233 | 233 | |
234 | 234 | if ($this->limit !== null) { |
235 | - $query = $query->take((int)$this->limit); |
|
235 | + $query = $query->take((int) $this->limit); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | if ($this->page > 0 && $this->limit !== null) { |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * For the full copyright and license information, please view the LICENSE |
5 | 5 | * file that was distributed with this source code. |
6 | 6 | */ |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace App\GraphQL\Queries\Support; |
10 | 10 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | $validator = $factory->make($args, $rules, $this->messages()); |
32 | 32 | |
33 | - $validator->after(function ($validator) use ($args) { |
|
33 | + $validator->after(function($validator) use ($args) { |
|
34 | 34 | $this->afterValidation($validator, $args); |
35 | 35 | }); |
36 | 36 | |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | * @param array $args |
58 | 58 | * @return \Generator|null |
59 | 59 | */ |
60 | - public function validate(Validator $validator, array $args = []): ?\Generator |
|
60 | + public function validate(Validator $validator, array $args = []): ? \Generator |
|
61 | 61 | { |
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * @return array |
66 | 66 | */ |
67 | - public function messages(): array |
|
67 | + public function messages() : array |
|
68 | 68 | { |
69 | 69 | return []; |
70 | 70 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace App\GraphQL\Queries; |
11 | 11 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | { |
50 | 50 | $query = $this->queryFor(Article::class, $args); |
51 | 51 | |
52 | - $this->whenExists($args, 'slug', function (array $slug) use ($query) { |
|
52 | + $this->whenExists($args, 'slug', function(array $slug) use ($query) { |
|
53 | 53 | return $query->whereIn('slug', $slug); |
54 | 54 | }); |
55 | 55 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * For the full copyright and license information, please view the LICENSE |
5 | 5 | * file that was distributed with this source code. |
6 | 6 | */ |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace App\GraphQL\Types; |
10 | 10 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | $query = $this->extendQuery($query, $args); |
92 | 92 | |
93 | - $this->whenExists($args, 'slug', function (string $slug) use ($query) { |
|
93 | + $this->whenExists($args, 'slug', function(string $slug) use ($query) { |
|
94 | 94 | return $query->where('slug', $slug); |
95 | 95 | }); |
96 | 96 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | * For the full copyright and license information, please view the LICENSE |
5 | 5 | * file that was distributed with this source code. |
6 | 6 | */ |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace App\GraphQL\Feature; |
10 | 10 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * For the full copyright and license information, please view the LICENSE |
5 | 5 | * file that was distributed with this source code. |
6 | 6 | */ |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace App\GraphQL\Feature; |
10 | 10 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $this->transfer = new EnumTransfer(); |
34 | 34 | |
35 | - $this->addFieldsWrapper(function (array $arguments) { |
|
35 | + $this->addFieldsWrapper(function(array $arguments) { |
|
36 | 36 | foreach ($arguments as $key => $data) { |
37 | 37 | yield $key => $this->configs($data); |
38 | 38 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * For the full copyright and license information, please view the LICENSE |
5 | 5 | * file that was distributed with this source code. |
6 | 6 | */ |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace App\GraphQL\Feature; |
10 | 10 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | $this->addArgument('id', Type::listOf(Type::id())); |
28 | 28 | |
29 | - $this->addQueryFor('id', function (Builder $builder, array $ids) { |
|
29 | + $this->addQueryFor('id', function(Builder $builder, array $ids) { |
|
30 | 30 | return $builder->whereIn('id', $ids); |
31 | 31 | }); |
32 | 32 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | * For the full copyright and license information, please view the LICENSE |
5 | 5 | * file that was distributed with this source code. |
6 | 6 | */ |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace App\GraphQL\Feature\Kernel; |
10 | 10 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * For the full copyright and license information, please view the LICENSE |
5 | 5 | * file that was distributed with this source code. |
6 | 6 | */ |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace App\GraphQL\Feature\Kernel; |
10 | 10 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $this->args[$name] = [ |
47 | 47 | 'type' => $type, |
48 | - 'description' => $description ?? Str::ucfirst($name) . ' field of ' . get_class($this), |
|
48 | + 'description' => $description ?? Str::ucfirst($name).' field of '.get_class($this), |
|
49 | 49 | ]; |
50 | 50 | |
51 | 51 | return $this; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function addQueryFor(string $argument, \Closure $resolveQuery) |
82 | 82 | { |
83 | 83 | $this->queries[] = function(Builder $builder, array $args = []) use ($argument, $resolveQuery) { |
84 | - return $this->whenExists($args, $argument, function ($value) use ($builder, $resolveQuery) { |
|
84 | + return $this->whenExists($args, $argument, function($value) use ($builder, $resolveQuery) { |
|
85 | 85 | return $resolveQuery($builder, $value); |
86 | 86 | }) ?? $builder; |
87 | 87 | }; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | protected function bootTraits(): void |
104 | 104 | { |
105 | 105 | foreach (class_uses_recursive(static::class) as $trait) { |
106 | - if (method_exists($this, $method = 'boot' . class_basename($trait))) { |
|
106 | + if (method_exists($this, $method = 'boot'.class_basename($trait))) { |
|
107 | 107 | call_user_func([$this, $method]); |
108 | 108 | } |
109 | 109 | } |