Passed
Push — master ( 01c2bb...d7bd96 )
by Michael
02:19
created
src/DependencyInjection/JsonApiExtension.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
         $loader->load('mapper.yml');
49 49
         $loader->load('http_client.yml');
50 50
 
51
-        if (! empty($config['mappers'])) {
52
-            $this->createMappers($config['mappers'], $container);
51
+        if (!empty($config[ 'mappers' ])) {
52
+            $this->createMappers($config[ 'mappers' ], $container);
53 53
         }
54 54
 
55
-        if (! empty($config['resource_clients'])) {
56
-            $this->createResourceClients($config['resource_clients'], $container);
55
+        if (!empty($config[ 'resource_clients' ])) {
56
+            $this->createResourceClients($config[ 'resource_clients' ], $container);
57 57
         }
58 58
     }
59 59
 
@@ -70,16 +70,16 @@  discard block
 block discarded – undo
70 70
         foreach ($config as $name => $mapperDefinition)
71 71
         {
72 72
             $mapper = new DefinitionDecorator('mrtn_json_api.object_mapper.abstract');
73
-            $mapper->addTag('mrtn_json_api.object_mapper', ['alias' => $name]);
73
+            $mapper->addTag('mrtn_json_api.object_mapper', [ 'alias' => $name ]);
74 74
 
75
-            foreach ($mapperDefinition['handlers'] as $handlerName)
75
+            foreach ($mapperDefinition[ 'handlers' ] as $handlerName)
76 76
             {
77
-                if (! isset($handlers[$handlerName])) {
77
+                if (!isset($handlers[ $handlerName ])) {
78 78
                     throw new \LogicException(sprintf('Mapping handler with name "%s" has not been registered as a service.', $handlerName));
79 79
                 }
80 80
 
81 81
                 $mapper->addMethodCall('addHandler', [
82
-                    new Reference($handlers[$handlerName])
82
+                    new Reference($handlers[ $handlerName ])
83 83
                 ]);
84 84
             }
85 85
 
@@ -97,17 +97,17 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $handlers = $container->findTaggedServiceIds('mrtn_json_api.object_mapper.handler');
99 99
 
100
-        $found = [];
100
+        $found = [ ];
101 101
 
102 102
         foreach ($handlers as $id => $tags)
103 103
         {
104 104
             foreach ($tags as $tag)
105 105
             {
106
-                if (! isset($tag['alias'])) {
106
+                if (!isset($tag[ 'alias' ])) {
107 107
                     continue;
108 108
                 }
109 109
 
110
-                $found[$tag['alias']] = $id;
110
+                $found[ $tag[ 'alias' ] ] = $id;
111 111
             }
112 112
         }
113 113
 
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 
128 128
         foreach ($config as $name => $definition)
129 129
         {
130
-            $routes = $this->createRoutesDefinition($definition['resources']);
130
+            $routes = $this->createRoutesDefinition($definition[ 'resources' ]);
131 131
 
132
-            $repository = new Definition($repositoryClass, [$definition['base_url'], $routes]);
132
+            $repository = new Definition($repositoryClass, [ $definition[ 'base_url' ], $routes ]);
133 133
             $repository->setPublic(false);
134 134
 
135 135
             $client = new Definition($clientClass, [
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
      */
151 151
     protected function createRoutesDefinition(array $resources): array
152 152
     {
153
-        $definition = [];
153
+        $definition = [ ];
154 154
 
155 155
         foreach ($resources as $name => $resource)
156 156
         {
157
-            $methods = array_keys($resource['methods']);
157
+            $methods = array_keys($resource[ 'methods' ]);
158 158
             $methods = array_map('strtoupper', $methods);
159 159
 
160
-            $definition[$name] = [
161
-                'path'    => trim($resource['path']),
160
+            $definition[ $name ] = [
161
+                'path'    => trim($resource[ 'path' ]),
162 162
                 'methods' => array_map('trim', $methods)
163 163
             ];
164 164
         }
Please login to merge, or discard this patch.
src/HttpClient/ResourceBasedClient.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -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.