Passed
Push — master ( 384709...16ae1e )
by Michael
09:23
created
src/Builder/DocumentBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Mikemirten\Bundle\JsonApiBundle\Builder;
5 5
 
Please login to merge, or discard this patch.
src/Request/Exception/InvalidDocumentTypeException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Mikemirten\Bundle\JsonApiBundle\Request\Exception;
5 5
 
Please login to merge, or discard this patch.
src/Request/Exception/InvalidMediaTypeException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Mikemirten\Bundle\JsonApiBundle\Request\Exception;
5 5
 
Please login to merge, or discard this patch.
src/JsonApiBundle.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Mikemirten\Bundle\JsonApiBundle;
5 5
 
Please login to merge, or discard this patch.
src/HttpClient/ResourceBasedClient.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Mikemirten\Bundle\JsonApiBundle\HttpClient;
5 5
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      *
61 61
      * @return ResponseInterface
62 62
      */
63
-    public function request(string $method, string $resource, array $parameters = [], array $headers = [], $body = null): ResponseInterface
63
+    public function request(string $method, string $resource, array $parameters = [ ], array $headers = [ ], $body = null): ResponseInterface
64 64
     {
65 65
         $uri = $this->repository->generate($resource, $parameters);
66 66
 
@@ -86,6 +86,6 @@  discard block
 block discarded – undo
86 86
     {
87 87
         array_unshift($arguments, strtoupper($name));
88 88
 
89
-        return call_user_func_array([$this, 'request'], $arguments);
89
+        return call_user_func_array([ $this, 'request' ], $arguments);
90 90
     }
91 91
 }
92 92
\ No newline at end of file
Please login to merge, or discard this patch.
src/DependencyInjection/JsonApiExtension.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Mikemirten\Bundle\JsonApiBundle\DependencyInjection;
5 5
 
@@ -50,16 +50,16 @@  discard block
 block discarded – undo
50 50
 
51 51
         $this->handleMappingDefinitionProvider($container);
52 52
 
53
-        if (! empty($config['mappers'])) {
54
-            $this->createMappers($config['mappers'], $container);
53
+        if (!empty($config[ 'mappers' ])) {
54
+            $this->createMappers($config[ 'mappers' ], $container);
55 55
         }
56 56
 
57
-        if (! empty($config['resource_clients'])) {
58
-            $this->createResourceClients($config['resource_clients'], $container);
57
+        if (!empty($config[ 'resource_clients' ])) {
58
+            $this->createResourceClients($config[ 'resource_clients' ], $container);
59 59
         }
60 60
 
61
-        if (! empty($config['http_client'])) {
62
-            $this->processHttpClient($config['http_client'], $container);
61
+        if (!empty($config[ 'http_client' ])) {
62
+            $this->processHttpClient($config[ 'http_client' ], $container);
63 63
         }
64 64
     }
65 65
 
@@ -71,17 +71,17 @@  discard block
 block discarded – undo
71 71
      */
72 72
     protected function processHttpClient(array $config, ContainerBuilder $container)
73 73
     {
74
-        if (empty($config['guzzle_service'])) {
74
+        if (empty($config[ 'guzzle_service' ])) {
75 75
             return;
76 76
         }
77 77
 
78
-        if ($container->hasDefinition($config['guzzle_service'])) {
78
+        if ($container->hasDefinition($config[ 'guzzle_service' ])) {
79 79
             throw new \LogicException(sprintf('Service "%s" has not been defined.'));
80 80
         }
81 81
 
82 82
         $container->getDefinition('mrtn_json_api.http_client.adapter.guzzle')
83 83
             ->setArguments([
84
-                new Reference($config['guzzle_service'])
84
+                new Reference($config[ 'guzzle_service' ])
85 85
             ]);
86 86
     }
87 87
 
@@ -122,16 +122,16 @@  discard block
 block discarded – undo
122 122
         foreach ($config as $name => $mapperDefinition)
123 123
         {
124 124
             $mapper = new ChildDefinition('mrtn_json_api.object_mapper.abstract');
125
-            $mapper->addTag('mrtn_json_api.object_mapper', ['alias' => $name]);
125
+            $mapper->addTag('mrtn_json_api.object_mapper', [ 'alias' => $name ]);
126 126
 
127
-            foreach ($mapperDefinition['handlers'] as $handlerName)
127
+            foreach ($mapperDefinition[ 'handlers' ] as $handlerName)
128 128
             {
129
-                if (! isset($handlers[$handlerName])) {
129
+                if (!isset($handlers[ $handlerName ])) {
130 130
                     throw new \LogicException(sprintf('Mapping handler with name "%s" has not been registered as a service.', $handlerName));
131 131
                 }
132 132
 
133 133
                 $mapper->addMethodCall('addHandler', [
134
-                    new Reference($handlers[$handlerName])
134
+                    new Reference($handlers[ $handlerName ])
135 135
                 ]);
136 136
             }
137 137
 
@@ -149,17 +149,17 @@  discard block
 block discarded – undo
149 149
     {
150 150
         $handlers = $container->findTaggedServiceIds('mrtn_json_api.object_mapper.handler');
151 151
 
152
-        $found = [];
152
+        $found = [ ];
153 153
 
154 154
         foreach ($handlers as $id => $tags)
155 155
         {
156 156
             foreach ($tags as $tag)
157 157
             {
158
-                if (! isset($tag['alias'])) {
158
+                if (!isset($tag[ 'alias' ])) {
159 159
                     continue;
160 160
                 }
161 161
 
162
-                $found[$tag['alias']] = $id;
162
+                $found[ $tag[ 'alias' ] ] = $id;
163 163
             }
164 164
         }
165 165
 
@@ -181,9 +181,9 @@  discard block
 block discarded – undo
181 181
         {
182 182
             $this->createEventDispatcherDecorator($container, $name);
183 183
 
184
-            $routes = $this->createRoutesDefinition($definition['resources']);
184
+            $routes = $this->createRoutesDefinition($definition[ 'resources' ]);
185 185
 
186
-            $repository = new Definition($repositoryClass, [$definition['base_url'], $routes]);
186
+            $repository = new Definition($repositoryClass, [ $definition[ 'base_url' ], $routes ]);
187 187
             $repository->setPublic(false);
188 188
 
189 189
             $client = new Definition($clientClass, [
@@ -227,15 +227,15 @@  discard block
 block discarded – undo
227 227
      */
228 228
     protected function createRoutesDefinition(array $resources): array
229 229
     {
230
-        $definition = [];
230
+        $definition = [ ];
231 231
 
232 232
         foreach ($resources as $name => $resource)
233 233
         {
234
-            $methods = array_keys($resource['methods']);
234
+            $methods = array_keys($resource[ 'methods' ]);
235 235
             $methods = array_map('strtoupper', $methods);
236 236
 
237
-            $definition[$name] = [
238
-                'path'    => trim($resource['path']),
237
+            $definition[ $name ] = [
238
+                'path'    => trim($resource[ 'path' ]),
239 239
                 'methods' => array_map('trim', $methods)
240 240
             ];
241 241
         }
Please login to merge, or discard this patch.
src/DependencyInjection/JsonApiConfiguration.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Mikemirten\Bundle\JsonApiBundle\DependencyInjection;
5 5
 
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
             /* @see https://github.com/symfony/symfony/issues/12304 */
42 42
             ->useAttributeAsKey(true)
43 43
 
44
-            ->defaultValue(['default' => [
44
+            ->defaultValue([ 'default' => [
45 45
                 'handlers' => [
46 46
                     'attribute',
47 47
                     'relationship',
48 48
                     'link'
49 49
                 ]
50
-            ]])
50
+            ] ])
51 51
             ->prototype('array')
52 52
                 ->children()
53 53
                     ->arrayNode('handlers')
Please login to merge, or discard this patch.
src/DependencyInjection/Compiler/DocumentHydratorCompilerPass.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Mikemirten\Bundle\JsonApiBundle\DependencyInjection\Compiler;
5 5
 
Please login to merge, or discard this patch.
src/DependencyInjection/Compiler/ObjectMapperCompilerPass.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Mikemirten\Bundle\JsonApiBundle\DependencyInjection\Compiler;
5 5
 
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
         foreach ($repositories as $id => $tags) {
32 32
             foreach ($tags as $tag)
33 33
             {
34
-                if (! isset($tag['alias'])) {
34
+                if (!isset($tag[ 'alias' ])) {
35 35
                     throw new \LogicException('Alias must be defined for a "link-repository" tag');
36 36
                 }
37 37
 
38 38
                 $definition->addMethodCall('registerRepository', [
39
-                    trim($tag['alias']),
39
+                    trim($tag[ 'alias' ]),
40 40
                     new Reference($id)
41 41
                 ]);
42 42
             }
Please login to merge, or discard this patch.