@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public static function allRules() |
126 | 126 | { |
127 | - if (! self::$initRules) { |
|
127 | + if (!self::$initRules) { |
|
128 | 128 | static::$rules = array_merge(static::defaultRules(), self::securityRules(), self::$rules); |
129 | 129 | static::$initRules = true; |
130 | 130 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | return is_array($value) |
265 | 265 | ? count(array_filter( |
266 | 266 | $value, |
267 | - static function ($item) { |
|
267 | + static function($item) { |
|
268 | 268 | return $item instanceof Throwable; |
269 | 269 | } |
270 | 270 | )) === count($value) |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | Visitor::visitWithTypeInfo( |
106 | 106 | $typeInfo, |
107 | 107 | [ |
108 | - NodeKind::VARIABLE_DEFINITION => static function () { |
|
108 | + NodeKind::VARIABLE_DEFINITION => static function() { |
|
109 | 109 | return false; |
110 | 110 | }, |
111 | - NodeKind::VARIABLE => static function (VariableNode $variable) use ( |
|
111 | + NodeKind::VARIABLE => static function(VariableNode $variable) use ( |
|
112 | 112 | &$newUsages, |
113 | 113 | $typeInfo |
114 | 114 | ) { |
@@ -139,19 +139,19 @@ discard block |
||
139 | 139 | $fragments = []; |
140 | 140 | $collectedNames = []; |
141 | 141 | $nodesToVisit = [$operation]; |
142 | - while (! empty($nodesToVisit)) { |
|
142 | + while (!empty($nodesToVisit)) { |
|
143 | 143 | $node = array_pop($nodesToVisit); |
144 | 144 | $spreads = $this->getFragmentSpreads($node); |
145 | 145 | foreach ($spreads as $spread) { |
146 | 146 | $fragName = $spread->name->value; |
147 | 147 | |
148 | - if (! empty($collectedNames[$fragName])) { |
|
148 | + if (!empty($collectedNames[$fragName])) { |
|
149 | 149 | continue; |
150 | 150 | } |
151 | 151 | |
152 | 152 | $collectedNames[$fragName] = true; |
153 | 153 | $fragment = $this->getFragment($fragName); |
154 | - if (! $fragment) { |
|
154 | + if (!$fragment) { |
|
155 | 155 | continue; |
156 | 156 | } |
157 | 157 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $spreads = []; |
178 | 178 | /** @var SelectionSetNode[] $setsToVisit */ |
179 | 179 | $setsToVisit = [$node->selectionSet]; |
180 | - while (! empty($setsToVisit)) { |
|
180 | + while (!empty($setsToVisit)) { |
|
181 | 181 | $set = array_pop($setsToVisit); |
182 | 182 | |
183 | 183 | for ($i = 0, $selectionCount = count($set->selections); $i < $selectionCount; $i++) { |
@@ -207,10 +207,10 @@ discard block |
||
207 | 207 | public function getFragment($name) |
208 | 208 | { |
209 | 209 | $fragments = $this->fragments; |
210 | - if (! $fragments) { |
|
210 | + if (!$fragments) { |
|
211 | 211 | $fragments = []; |
212 | 212 | foreach ($this->getDocument()->definitions as $statement) { |
213 | - if (! ($statement instanceof FragmentDefinitionNode)) { |
|
213 | + if (!($statement instanceof FragmentDefinitionNode)) { |
|
214 | 214 | continue; |
215 | 215 | } |
216 | 216 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | 'args' => [ |
20 | 20 | 'message' => ['type' => Type::string()], |
21 | 21 | ], |
22 | - 'resolve' => function ($rootValue, $args) { |
|
22 | + 'resolve' => function($rootValue, $args) { |
|
23 | 23 | return $rootValue['prefix'] . $args['message']; |
24 | 24 | } |
25 | 25 | ], |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | 'x' => ['type' => Type::int()], |
36 | 36 | 'y' => ['type' => Type::int()], |
37 | 37 | ], |
38 | - 'resolve' => function ($calc, $args) { |
|
38 | + 'resolve' => function($calc, $args) { |
|
39 | 39 | return $args['x'] + $args['y']; |
40 | 40 | }, |
41 | 41 | ], |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function resolve($rootValue, $args, $context) |
18 | 18 | { |
19 | - return $rootValue['prefix'].$args['message']; |
|
19 | + return $rootValue['prefix'] . $args['message']; |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | { |
175 | 175 | $commentReplies = isset(self::$commentReplies[$commentId]) ? self::$commentReplies[$commentId] : []; |
176 | 176 | |
177 | - $start = isset($after) ? (int) array_search($afterId, $commentReplies) + 1: 0; |
|
177 | + $start = isset($after) ? (int) array_search($afterId, $commentReplies) + 1 : 0; |
|
178 | 178 | $commentReplies = array_slice($commentReplies, $start, $limit); |
179 | 179 | |
180 | 180 | return array_map( |
@@ -197,6 +197,6 @@ discard block |
||
197 | 197 | |
198 | 198 | public static function findStoryMentions($storyId) |
199 | 199 | { |
200 | - return isset(self::$storyMentions[$storyId]) ? self::$storyMentions[$storyId] :[]; |
|
200 | + return isset(self::$storyMentions[$storyId]) ? self::$storyMentions[$storyId] : []; |
|
201 | 201 | } |
202 | 202 | } |
@@ -121,15 +121,15 @@ |
||
121 | 121 | return DataSource::findComments($story->id, $args['limit'], $args['after']); |
122 | 122 | } |
123 | 123 | |
124 | - public function resolveMentions(Story $story, $args, AppContext $context){ |
|
124 | + public function resolveMentions(Story $story, $args, AppContext $context) { |
|
125 | 125 | return DataSource::findStoryMentions($story->id); |
126 | 126 | } |
127 | 127 | |
128 | - public function resolveLikedBy(Story $story, $args, AppContext $context){ |
|
129 | - return DataSource::findLikes($story->id,10); |
|
128 | + public function resolveLikedBy(Story $story, $args, AppContext $context) { |
|
129 | + return DataSource::findLikes($story->id, 10); |
|
130 | 130 | } |
131 | 131 | |
132 | - public function resolveLikes(Story $story, $args, AppContext $context){ |
|
133 | - return DataSource::findLikes($story->id,10); |
|
132 | + public function resolveLikes(Story $story, $args, AppContext $context) { |
|
133 | + return DataSource::findLikes($story->id, 10); |
|
134 | 134 | } |
135 | 135 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | return new Schema( |
68 | 68 | SchemaConfig::create() |
69 | 69 | ->setQuery($this->schemaBuilder->buildQueryType()) |
70 | - ->setTypeLoader(function ($name) { |
|
70 | + ->setTypeLoader(function($name) { |
|
71 | 71 | return $this->schemaBuilder->loadType($name); |
72 | 72 | }) |
73 | 73 | ); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | $totalFields = 0; |
35 | 35 | foreach ($schema->getTypeMap() as $type) { |
36 | - if (! ($type instanceof ObjectType)) { |
|
36 | + if (!($type instanceof ObjectType)) { |
|
37 | 37 | continue; |
38 | 38 | } |
39 | 39 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | { |
57 | 57 | if ($this->typeIndex > $this->config['totalTypes']) { |
58 | 58 | throw new \Exception( |
59 | - "Cannot create new type: there are already {$this->typeIndex} ". |
|
59 | + "Cannot create new type: there are already {$this->typeIndex} " . |
|
60 | 60 | "which exceeds allowed number of {$this->config['totalTypes']} types total" |
61 | 61 | ); |
62 | 62 | } |