We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | public function getFunctions() |
20 | 20 | { |
21 | 21 | return [ |
22 | - new ExpressionFunction('hasRole', function () {}, function (array $variables, $role) { |
|
22 | + new ExpressionFunction('hasRole', function() {}, function(array $variables, $role) { |
|
23 | 23 | return $variables['container']->get('security.authorization_checker')->isGranted($role); |
24 | 24 | }), |
25 | 25 | |
26 | - new ExpressionFunction('hasAnyRole', function () {}, function (array $variables, array $roles) { |
|
26 | + new ExpressionFunction('hasAnyRole', function() {}, function(array $variables, array $roles) { |
|
27 | 27 | foreach ($roles as $role) { |
28 | 28 | if ($variables['container']->get('security.authorization_checker')->isGranted($role)) { |
29 | 29 | return true; |
@@ -33,29 +33,29 @@ discard block |
||
33 | 33 | return false; |
34 | 34 | }), |
35 | 35 | |
36 | - new ExpressionFunction('isAnonymous', function () {}, function (array $variables) { |
|
36 | + new ExpressionFunction('isAnonymous', function() {}, function(array $variables) { |
|
37 | 37 | return $variables['container']->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_ANONYMOUSLY'); |
38 | 38 | }), |
39 | 39 | |
40 | - new ExpressionFunction('isRememberMe', function () {}, function (array $variables) { |
|
40 | + new ExpressionFunction('isRememberMe', function() {}, function(array $variables) { |
|
41 | 41 | return $variables['container']->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED'); |
42 | 42 | }), |
43 | 43 | |
44 | - new ExpressionFunction('isFullyAuthenticated', function () {}, function (array $variables) { |
|
44 | + new ExpressionFunction('isFullyAuthenticated', function() {}, function(array $variables) { |
|
45 | 45 | return $variables['container']->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY'); |
46 | 46 | }), |
47 | 47 | |
48 | - new ExpressionFunction('isAuthenticated', function () {}, function (array $variables) { |
|
48 | + new ExpressionFunction('isAuthenticated', function() {}, function(array $variables) { |
|
49 | 49 | return |
50 | 50 | $variables['container']->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED') |
51 | 51 | || $variables['container']->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY'); |
52 | 52 | }), |
53 | 53 | |
54 | - new ExpressionFunction('hasPermission', function () {}, function (array $variables, $object, $permission) { |
|
54 | + new ExpressionFunction('hasPermission', function() {}, function(array $variables, $object, $permission) { |
|
55 | 55 | return $variables['container']->get('security.authorization_checker')->isGranted($permission, $object); |
56 | 56 | }), |
57 | 57 | |
58 | - new ExpressionFunction('hasAnyPermission', function () {}, function (array $variables, $object, array $permissions) { |
|
58 | + new ExpressionFunction('hasAnyPermission', function() {}, function(array $variables, $object, array $permissions) { |
|
59 | 59 | foreach ($permissions as $permission) { |
60 | 60 | if ($variables['container']->get('security.authorization_checker')->isGranted($permission, $object)) { |
61 | 61 | return true; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | return $value; |
20 | 20 | } |
21 | 21 | |
22 | - return function () use ($value) { |
|
22 | + return function() use ($value) { |
|
23 | 23 | $args = func_get_args(); |
24 | 24 | $result = $this->solveUsingExpressionLanguageIfNeeded( |
25 | 25 | $value, |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | public function solveTypeCallback($values) |
20 | 20 | { |
21 | - return function () use ($values) { |
|
21 | + return function() use ($values) { |
|
22 | 22 | return $this->solveType($values); |
23 | 23 | }; |
24 | 24 | } |
@@ -163,7 +163,7 @@ |
||
163 | 163 | private function invokeResolveAccessAndWrapResolveCallback($hasAccess, callable $callback = null) |
164 | 164 | { |
165 | 165 | if (null === $callback) { |
166 | - $callback = function ($value) { |
|
166 | + $callback = function($value) { |
|
167 | 167 | return $value; |
168 | 168 | }; |
169 | 169 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ['foo'], |
47 | 47 | ], |
48 | 48 | [ |
49 | - function () { |
|
49 | + function() { |
|
50 | 50 | return ['test']; |
51 | 51 | }, |
52 | 52 | ['bar'], |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | public function testGetFieldsWithDefaultsForceArray() |
66 | 66 | { |
67 | - $fields = $this->getFieldsWithDefaults(function () { return ['bar']; }, ['toto'], false); |
|
67 | + $fields = $this->getFieldsWithDefaults(function() { return ['bar']; }, ['toto'], false); |
|
68 | 68 | $this->assertInstanceOf('Closure', $fields); |
69 | 69 | $this->assertEquals(['bar', 'toto'], $fields()); |
70 | 70 | } |
@@ -149,6 +149,9 @@ |
||
149 | 149 | return $treatedOptions; |
150 | 150 | } |
151 | 151 | |
152 | + /** |
|
153 | + * @param callable $expression |
|
154 | + */ |
|
152 | 155 | private function resolveAccessAndWrapResolveCallback($expression, callable $resolveCallback = null) |
153 | 156 | { |
154 | 157 | return function () use ($expression, $resolveCallback) { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $value = $treatedOptions['complexity']; |
71 | 71 | |
72 | - $treatedOptions['complexity'] = function () use ($value) { |
|
72 | + $treatedOptions['complexity'] = function() use ($value) { |
|
73 | 73 | $args = func_get_args(); |
74 | 74 | $complexity = $this->solveUsingExpressionLanguageIfNeeded( |
75 | 75 | $value, |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | private function resolveAccessAndWrapResolveCallback($expression, callable $resolveCallback) |
182 | 182 | { |
183 | - return function () use ($expression, $resolveCallback) { |
|
183 | + return function() use ($expression, $resolveCallback) { |
|
184 | 184 | $args = func_get_args(); |
185 | 185 | |
186 | 186 | $values = call_user_func_array([$this, 'solveResolveCallbackArgs'], $args); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | switch (true) { |
206 | 206 | case is_array($result): |
207 | 207 | $result = array_map( |
208 | - function ($object) use ($checkAccess) { |
|
208 | + function($object) use ($checkAccess) { |
|
209 | 209 | return $checkAccess($object) ? $object : null; |
210 | 210 | }, |
211 | 211 | $result |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | case $result instanceof Connection: |
216 | 216 | $result->edges = array_map( |
217 | - function (Edge $edge) use ($checkAccess) { |
|
217 | + function(Edge $edge) use ($checkAccess) { |
|
218 | 218 | $edge->node = $checkAccess($edge->node) ? $edge->node : null; |
219 | 219 | |
220 | 220 | return $edge; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | private function checkAccessCallback($expression, $values) |
235 | 235 | { |
236 | - return function ($object, $throwException = false) use ($expression, $values) { |
|
236 | + return function($object, $throwException = false) use ($expression, $values) { |
|
237 | 237 | try { |
238 | 238 | $access = $this->solveUsingExpressionLanguageIfNeeded( |
239 | 239 | $expression, |
@@ -165,7 +165,7 @@ |
||
165 | 165 | $client->request('POST', '/?batch', [], [], ['CONTENT_TYPE' => 'application/json'], json_encode($data)); |
166 | 166 | $result = $client->getResponse()->getContent(); |
167 | 167 | |
168 | - $expected = [ |
|
168 | + $expected = [ |
|
169 | 169 | 'friends' => ['data' => $this->expectedData], |
170 | 170 | 'friendsTotalCount' => ['data' => ['user' => ['friends' => ['totalCount' => 4]]]], |
171 | 171 | ]; |
@@ -111,12 +111,12 @@ |
||
111 | 111 | $node |
112 | 112 | ->info('Disabled if equal to false.') |
113 | 113 | ->beforeNormalization() |
114 | - ->ifTrue(function ($v) { return false === $v; }) |
|
115 | - ->then(function () use ($disabledValue) { return $disabledValue; }) |
|
114 | + ->ifTrue(function($v) { return false === $v; }) |
|
115 | + ->then(function() use ($disabledValue) { return $disabledValue; }) |
|
116 | 116 | ->end() |
117 | 117 | ->defaultFalse() |
118 | 118 | ->validate() |
119 | - ->ifTrue(function ($v) { return $v < 0; }) |
|
119 | + ->ifTrue(function($v) { return $v < 0; }) |
|
120 | 120 | ->thenInvalid('"overblog_graphql.security.'.$name.'" must be greater or equal to 0.') |
121 | 121 | ->end() |
122 | 122 | ; |
@@ -127,9 +127,9 @@ |
||
127 | 127 | // from config |
128 | 128 | if (!empty($config['definitions']['mappings']['types'])) { |
129 | 129 | $typesMappings = array_filter(array_map( |
130 | - function (array $typeMapping) use ($container) { |
|
130 | + function(array $typeMapping) use ($container) { |
|
131 | 131 | |
132 | - $params = $this->detectConfigFiles($container, $typeMapping['dir'], $typeMapping['type']); |
|
132 | + $params = $this->detectConfigFiles($container, $typeMapping['dir'], $typeMapping['type']); |
|
133 | 133 | |
134 | 134 | return $params; |
135 | 135 | }, |