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, |
@@ -108,7 +108,7 @@ |
||
108 | 108 | |
109 | 109 | protected function solveUsingExpressionLanguageIfNeeded($expression, array $values = []) |
110 | 110 | { |
111 | - if (is_string($expression) && 0 === strpos($expression, '@=')) { |
|
111 | + if (is_string($expression) && 0 === strpos($expression, '@=')) { |
|
112 | 112 | return $this->expressionLanguage->evaluate(substr($expression, 2), $values); |
113 | 113 | } |
114 | 114 |
@@ -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) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | $value = $treatedOptions['complexity']; |
70 | 70 | |
71 | - $treatedOptions['complexity'] = function () use ($value) { |
|
71 | + $treatedOptions['complexity'] = function() use ($value) { |
|
72 | 72 | $args = func_get_args(); |
73 | 73 | $complexity = $this->solveUsingExpressionLanguageIfNeeded( |
74 | 74 | $value, |
@@ -179,10 +179,10 @@ discard block |
||
179 | 179 | |
180 | 180 | private function resolveAccessAndWrapResolveCallback($expression, callable $resolveCallback = null) |
181 | 181 | { |
182 | - return function () use ($expression, $resolveCallback) { |
|
182 | + return function() use ($expression, $resolveCallback) { |
|
183 | 183 | $args = func_get_args(); |
184 | 184 | |
185 | - $result = null !== $resolveCallback ? call_user_func_array($resolveCallback, $args) : null; |
|
185 | + $result = null !== $resolveCallback ? call_user_func_array($resolveCallback, $args) : null; |
|
186 | 186 | |
187 | 187 | $values = call_user_func_array([$this, 'solveResolveCallbackArgs'], $args); |
188 | 188 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | case is_array($result) || $result instanceof \ArrayAccess: |
199 | 199 | $result = array_filter( |
200 | 200 | array_map( |
201 | - function ($object) use ($checkAccess) { |
|
201 | + function($object) use ($checkAccess) { |
|
202 | 202 | return $checkAccess($object) ? $object : null; |
203 | 203 | }, |
204 | 204 | $result |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | case $result instanceof Connection: |
210 | 210 | $result->edges = array_map( |
211 | - function (Edge $edge) use ($checkAccess) { |
|
211 | + function(Edge $edge) use ($checkAccess) { |
|
212 | 212 | $edge->node = $checkAccess($edge->node) ? $edge->node : null; |
213 | 213 | |
214 | 214 | return $edge; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | private function checkAccessCallback($expression, $values) |
229 | 229 | { |
230 | - return function ($object, $throwException = false) use ($expression, $values) { |
|
230 | + return function($object, $throwException = false) use ($expression, $values) { |
|
231 | 231 | try { |
232 | 232 | $access = $this->solveUsingExpressionLanguageIfNeeded( |
233 | 233 | $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 | ]; |
@@ -41,6 +41,7 @@ |
||
41 | 41 | * check if equal to 0 no check is done. Must be greater or equal to 0. |
42 | 42 | * |
43 | 43 | * @param $value |
44 | + * @param string $name |
|
44 | 45 | */ |
45 | 46 | protected static function checkIfGreaterOrEqualToZero($name, $value) |
46 | 47 | { |