We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $rootNode = $treeBuilder->root('overblog_graphql_types'); |
37 | 37 | |
38 | 38 | $configTypeKeys = array_map( |
39 | - function ($type) { |
|
39 | + function($type) { |
|
40 | 40 | return $this->normalizedConfigTypeKey($type); |
41 | 41 | }, |
42 | 42 | static::$types |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ->prototype('array') |
50 | 50 | // config is the unique config entry allowed |
51 | 51 | ->beforeNormalization() |
52 | - ->ifTrue(function ($v) use ($configTypeKeys) { |
|
52 | + ->ifTrue(function($v) use ($configTypeKeys) { |
|
53 | 53 | if (!empty($v) && is_array($v)) { |
54 | 54 | $keys = array_keys($v); |
55 | 55 | foreach ($configTypeKeys as $configTypeKey) { |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | ->thenInvalid( |
65 | 65 | sprintf( |
66 | 66 | 'Don\'t use internal config keys %s, replace it by "config" instead.', |
67 | - implode(', ', $configTypeKeys) |
|
67 | + implode(', ', $configTypeKeys) |
|
68 | 68 | ) |
69 | 69 | ) |
70 | 70 | ->end() |
71 | 71 | // config is renamed _{TYPE}_config |
72 | 72 | ->beforeNormalization() |
73 | - ->ifTrue(function ($v) { |
|
73 | + ->ifTrue(function($v) { |
|
74 | 74 | return isset($v['type']) && is_string($v['type']); |
75 | 75 | }) |
76 | - ->then(function ($v) { |
|
76 | + ->then(function($v) { |
|
77 | 77 | $key = $this->normalizedConfigTypeKey($v['type']); |
78 | 78 | |
79 | 79 | if (empty($v[$key])) { |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | ->end() |
97 | 97 | // _{TYPE}_config is renamed config |
98 | 98 | ->validate() |
99 | - ->ifTrue(function ($v) { |
|
99 | + ->ifTrue(function($v) { |
|
100 | 100 | return isset($v[$this->normalizedConfigTypeKey($v['type'])]); |
101 | 101 | }) |
102 | - ->then(function ($v) { |
|
102 | + ->then(function($v) { |
|
103 | 103 | $key = $this->normalizedConfigTypeKey($v['type']); |
104 | 104 | $v['config'] = $v[$key]; |
105 | 105 | unset($v[$key]); |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | |
116 | 116 | private function addBeforeNormalization(ArrayNodeDefinition $node) |
117 | 117 | { |
118 | - $typeKeyExists = function ($types) { return !empty($types) && is_array($types); }; |
|
118 | + $typeKeyExists = function($types) { return !empty($types) && is_array($types); }; |
|
119 | 119 | |
120 | 120 | $node |
121 | 121 | // set type config.name |
122 | 122 | ->beforeNormalization() |
123 | 123 | ->ifTrue($typeKeyExists) |
124 | - ->then(function ($types) { |
|
124 | + ->then(function($types) { |
|
125 | 125 | foreach ($types as $name => &$type) { |
126 | 126 | $type['config'] = isset($type['config']) && is_array($type['config']) ? $type['config'] : []; |
127 | 127 | $type['config']['name'] = $name; |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | ->end() |
148 | 148 | // normalized relay-mutation-payload |
149 | 149 | ->beforeNormalization() |
150 | - ->ifTrue(function ($types) { return !empty($types) && is_array($types); }) |
|
150 | + ->ifTrue(function($types) { return !empty($types) && is_array($types); }) |
|
151 | 151 | ->then($this->relayNormalizer('relay-mutation-payload', 'Overblog\GraphQLBundle\Relay\Mutation\PayloadDefinition')) |
152 | 152 | ->end(); |
153 | 153 | } |
154 | 154 | |
155 | 155 | private function relayNormalizer($typeToTreat, $definitionBuilderClass) |
156 | 156 | { |
157 | - return function ($types) use ($typeToTreat, $definitionBuilderClass) { |
|
157 | + return function($types) use ($typeToTreat, $definitionBuilderClass) { |
|
158 | 158 | foreach ($types as $name => $type) { |
159 | 159 | if (isset($type['type']) && is_string($type['type']) && $typeToTreat === $type['type']) { |
160 | 160 | $config = isset($type['config']) && is_array($type['config']) ? $type['config'] : []; |
@@ -40,7 +40,7 @@ |
||
40 | 40 | private function processConfig(array $configs) |
41 | 41 | { |
42 | 42 | return array_map( |
43 | - function ($v) { |
|
43 | + function($v) { |
|
44 | 44 | if (is_array($v)) { |
45 | 45 | return call_user_func([$this, 'processConfig'], $v); |
46 | 46 | } elseif (is_string($v) && 0 === strpos($v, '@=')) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | switch (true) { |
37 | 37 | case is_array($result): |
38 | 38 | $result = array_map( |
39 | - function ($object) use ($accessChecker, $resolveArgs) { |
|
39 | + function($object) use ($accessChecker, $resolveArgs) { |
|
40 | 40 | return $this->checkAccess($accessChecker, $object, $resolveArgs) ? $object : null; |
41 | 41 | }, |
42 | 42 | $result |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | break; |
45 | 45 | case $result instanceof Connection: |
46 | 46 | $result->edges = array_map( |
47 | - function (Edge $edge) use ($accessChecker, $resolveArgs) { |
|
47 | + function(Edge $edge) use ($accessChecker, $resolveArgs) { |
|
48 | 48 | $edge->node = $this->checkAccess($accessChecker, $edge->node, $resolveArgs) ? $edge->node : null; |
49 | 49 | |
50 | 50 | return $edge; |
@@ -22,91 +22,91 @@ discard block |
||
22 | 22 | return [ |
23 | 23 | new ExpressionFunction( |
24 | 24 | 'service', |
25 | - function ($value) { |
|
25 | + function($value) { |
|
26 | 26 | return sprintf('$container->get(%s)', $value); |
27 | 27 | }, |
28 | - function () {} |
|
28 | + function() {} |
|
29 | 29 | ), |
30 | 30 | |
31 | 31 | new ExpressionFunction( |
32 | 32 | 'parameter', |
33 | - function ($value) { |
|
33 | + function($value) { |
|
34 | 34 | return sprintf('$container->getParameter(%s)', $value); |
35 | 35 | }, |
36 | - function () {} |
|
36 | + function() {} |
|
37 | 37 | ), |
38 | 38 | |
39 | 39 | new ExpressionFunction( |
40 | 40 | 'isTypeOf', |
41 | - function ($className) { |
|
41 | + function($className) { |
|
42 | 42 | return sprintf('($className = %s) && $value instanceof $className', $className); |
43 | 43 | }, |
44 | - function () {} |
|
44 | + function() {} |
|
45 | 45 | ), |
46 | 46 | |
47 | 47 | new ExpressionFunction( |
48 | 48 | 'resolver', |
49 | - function ($alias, $args = '[]') { |
|
49 | + function($alias, $args = '[]') { |
|
50 | 50 | return sprintf('$container->get(\'overblog_graphql.resolver_resolver\')->resolve([%s, %s])', $alias, $args); |
51 | 51 | }, |
52 | - function () {} |
|
52 | + function() {} |
|
53 | 53 | ), |
54 | 54 | |
55 | 55 | new ExpressionFunction( |
56 | 56 | 'mutateAndGetPayloadCallback', |
57 | - function ($mutateAndGetPayload) { |
|
57 | + function($mutateAndGetPayload) { |
|
58 | 58 | $code = 'function ($value) use ('.TypeGenerator::USE_FOR_CLOSURES.', $args, $info) { '; |
59 | 59 | $code .= 'return '.$mutateAndGetPayload.'; }'; |
60 | 60 | |
61 | 61 | return $code; |
62 | 62 | }, |
63 | - function () {} |
|
63 | + function() {} |
|
64 | 64 | ), |
65 | 65 | |
66 | 66 | new ExpressionFunction( |
67 | 67 | 'mutateAndGetPayloadCallback', |
68 | - function ($mutateAndGetPayload) { |
|
68 | + function($mutateAndGetPayload) { |
|
69 | 69 | $code = 'function ($value) use ('.TypeGenerator::USE_FOR_CLOSURES.', $args, $info) { '; |
70 | 70 | $code .= 'return '.$mutateAndGetPayload.'; }'; |
71 | 71 | |
72 | 72 | return $code; |
73 | 73 | }, |
74 | - function () {} |
|
74 | + function() {} |
|
75 | 75 | ), |
76 | 76 | |
77 | 77 | new ExpressionFunction( |
78 | 78 | 'idFetcherCallback', |
79 | - function ($idFetcher) { |
|
79 | + function($idFetcher) { |
|
80 | 80 | $code = 'function ($value) use ('.TypeGenerator::USE_FOR_CLOSURES.', $args, $info) { '; |
81 | 81 | $code .= 'return '.$idFetcher.'; }'; |
82 | 82 | |
83 | 83 | return $code; |
84 | 84 | }, |
85 | - function () {} |
|
85 | + function() {} |
|
86 | 86 | ), |
87 | 87 | |
88 | 88 | new ExpressionFunction( |
89 | 89 | 'resolveSingleInputCallback', |
90 | - function ($resolveSingleInput) { |
|
90 | + function($resolveSingleInput) { |
|
91 | 91 | $code = 'function ($value) use ('.TypeGenerator::USE_FOR_CLOSURES.', $args, $info) { '; |
92 | 92 | $code .= 'return '.$resolveSingleInput.'; }'; |
93 | 93 | |
94 | 94 | return $code; |
95 | 95 | }, |
96 | - function () {} |
|
96 | + function() {} |
|
97 | 97 | ), |
98 | 98 | |
99 | 99 | new ExpressionFunction( |
100 | 100 | 'mutation', |
101 | - function ($alias, $args = '[]') { |
|
101 | + function($alias, $args = '[]') { |
|
102 | 102 | return sprintf('$container->get(\'overblog_graphql.mutation_resolver\')->resolve([%s, %s])', $alias, $args); |
103 | 103 | }, |
104 | - function () {} |
|
104 | + function() {} |
|
105 | 105 | ), |
106 | 106 | |
107 | 107 | new ExpressionFunction( |
108 | 108 | 'globalId', |
109 | - function ($id, $typeName = null) { |
|
109 | + function($id, $typeName = null) { |
|
110 | 110 | $typeNameEmpty = null === $typeName || '""' === $typeName || 'null' === $typeName || 'false' === $typeName; |
111 | 111 | |
112 | 112 | return sprintf( |
@@ -115,26 +115,26 @@ discard block |
||
115 | 115 | $id |
116 | 116 | ); |
117 | 117 | }, |
118 | - function () {} |
|
118 | + function() {} |
|
119 | 119 | ), |
120 | 120 | |
121 | 121 | new ExpressionFunction( |
122 | 122 | 'fromGlobalId', |
123 | - function ($globalId) { |
|
123 | + function($globalId) { |
|
124 | 124 | return sprintf( |
125 | 125 | '\\Overblog\\GraphQLBundle\\Relay\\Node\\GlobalId::fromGlobalId(%s)', |
126 | 126 | $globalId |
127 | 127 | ); |
128 | 128 | }, |
129 | - function () {} |
|
129 | + function() {} |
|
130 | 130 | ), |
131 | 131 | |
132 | 132 | new ExpressionFunction( |
133 | 133 | 'newObject', |
134 | - function ($className, $args = '[]') { |
|
134 | + function($className, $args = '[]') { |
|
135 | 135 | return sprintf('(new \ReflectionClass(%s))->newInstanceArgs(%s)', $className, $args); |
136 | 136 | }, |
137 | - function () {} |
|
137 | + function() {} |
|
138 | 138 | ), |
139 | 139 | ]; |
140 | 140 | } |
@@ -21,72 +21,72 @@ |
||
21 | 21 | return [ |
22 | 22 | new ExpressionFunction( |
23 | 23 | 'hasRole', |
24 | - function ($role) { |
|
24 | + function($role) { |
|
25 | 25 | return sprintf('$container->get(\'security.authorization_checker\')->isGranted(%s)', $role); |
26 | 26 | }, |
27 | - function () {} |
|
27 | + function() {} |
|
28 | 28 | ), |
29 | 29 | |
30 | 30 | new ExpressionFunction( |
31 | 31 | 'hasAnyRole', |
32 | - function ($roles) { |
|
32 | + function($roles) { |
|
33 | 33 | $code = sprintf('array_reduce(%s, function ($isGranted, $role) use ($container) { return $isGranted || $container->get(\'security.authorization_checker\')->isGranted($role); }, false)', $roles); |
34 | 34 | |
35 | 35 | return $code; |
36 | 36 | }, |
37 | - function () {} |
|
37 | + function() {} |
|
38 | 38 | ), |
39 | 39 | |
40 | 40 | new ExpressionFunction( |
41 | 41 | 'isAnonymous', |
42 | - function () { |
|
42 | + function() { |
|
43 | 43 | return '$container->get(\'security.authorization_checker\')->isGranted(\'IS_AUTHENTICATED_ANONYMOUSLY\')'; |
44 | 44 | }, |
45 | - function () {} |
|
45 | + function() {} |
|
46 | 46 | ), |
47 | 47 | |
48 | 48 | new ExpressionFunction( |
49 | 49 | 'isRememberMe', |
50 | - function () { |
|
50 | + function() { |
|
51 | 51 | return '$container->get(\'security.authorization_checker\')->isGranted(\'IS_AUTHENTICATED_REMEMBERED\')'; |
52 | 52 | }, |
53 | - function () {} |
|
53 | + function() {} |
|
54 | 54 | ), |
55 | 55 | |
56 | 56 | new ExpressionFunction( |
57 | 57 | 'isFullyAuthenticated', |
58 | - function () { |
|
58 | + function() { |
|
59 | 59 | return '$container->get(\'security.authorization_checker\')->isGranted(\'IS_AUTHENTICATED_FULLY\')'; |
60 | 60 | }, |
61 | - function () {} |
|
61 | + function() {} |
|
62 | 62 | ), |
63 | 63 | |
64 | 64 | new ExpressionFunction( |
65 | 65 | 'isAuthenticated', |
66 | - function () { |
|
66 | + function() { |
|
67 | 67 | return '$container->get(\'security.authorization_checker\')->isGranted(\'IS_AUTHENTICATED_REMEMBERED\') || $container->get(\'security.authorization_checker\')->isGranted(\'IS_AUTHENTICATED_FULLY\')'; |
68 | 68 | }, |
69 | - function () {} |
|
69 | + function() {} |
|
70 | 70 | ), |
71 | 71 | |
72 | 72 | new ExpressionFunction( |
73 | 73 | 'hasPermission', |
74 | - function ($object, $permission) { |
|
74 | + function($object, $permission) { |
|
75 | 75 | $code = sprintf('$container->get(\'security.authorization_checker\')->isGranted(%s, %s)', $permission, $object); |
76 | 76 | |
77 | 77 | return $code; |
78 | 78 | }, |
79 | - function () {} |
|
79 | + function() {} |
|
80 | 80 | ), |
81 | 81 | |
82 | 82 | new ExpressionFunction( |
83 | 83 | 'hasAnyPermission', |
84 | - function ($object, $permissions) { |
|
84 | + function($object, $permissions) { |
|
85 | 85 | $code = sprintf('array_reduce(%s, function ($isGranted, $permission) use ($container, $object) { return $isGranted || $container->get(\'security.authorization_checker\')->isGranted($permission, %s); }, false)', $permissions, $object); |
86 | 86 | |
87 | 87 | return $code; |
88 | 88 | }, |
89 | - function () {} |
|
89 | + function() {} |
|
90 | 90 | ), |
91 | 91 | ]; |
92 | 92 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | private function cleanResolveSingleInput($resolveSingleInput) |
51 | 51 | { |
52 | - if (is_string($resolveSingleInput) && 0 === strpos($resolveSingleInput, '@=')) { |
|
52 | + if (is_string($resolveSingleInput) && 0 === strpos($resolveSingleInput, '@=')) { |
|
53 | 53 | $cleanResolveSingleInput = substr($resolveSingleInput, 2); |
54 | 54 | } else { |
55 | 55 | $cleanResolveSingleInput = json_encode($resolveSingleInput); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | private function cleanMutateAndGetPayload($mutateAndGetPayload) |
40 | 40 | { |
41 | - if (is_string($mutateAndGetPayload) && 0 === strpos($mutateAndGetPayload, '@=')) { |
|
41 | + if (is_string($mutateAndGetPayload) && 0 === strpos($mutateAndGetPayload, '@=')) { |
|
42 | 42 | $cleanMutateAndGetPayload = substr($mutateAndGetPayload, 2); |
43 | 43 | } else { |
44 | 44 | $cleanMutateAndGetPayload = json_encode($mutateAndGetPayload); |