@@ -50,12 +50,12 @@ discard block |
||
| 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 | 61 | |
@@ -96,16 +96,16 @@ discard block |
||
| 96 | 96 | foreach ($config as $name => $mapperDefinition) |
| 97 | 97 | { |
| 98 | 98 | $mapper = new DefinitionDecorator('mrtn_json_api.object_mapper.abstract'); |
| 99 | - $mapper->addTag('mrtn_json_api.object_mapper', ['alias' => $name]); |
|
| 99 | + $mapper->addTag('mrtn_json_api.object_mapper', [ 'alias' => $name ]); |
|
| 100 | 100 | |
| 101 | - foreach ($mapperDefinition['handlers'] as $handlerName) |
|
| 101 | + foreach ($mapperDefinition[ 'handlers' ] as $handlerName) |
|
| 102 | 102 | { |
| 103 | - if (! isset($handlers[$handlerName])) { |
|
| 103 | + if (!isset($handlers[ $handlerName ])) { |
|
| 104 | 104 | throw new \LogicException(sprintf('Mapping handler with name "%s" has not been registered as a service.', $handlerName)); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | $mapper->addMethodCall('addHandler', [ |
| 108 | - new Reference($handlers[$handlerName]) |
|
| 108 | + new Reference($handlers[ $handlerName ]) |
|
| 109 | 109 | ]); |
| 110 | 110 | } |
| 111 | 111 | |
@@ -123,17 +123,17 @@ discard block |
||
| 123 | 123 | { |
| 124 | 124 | $handlers = $container->findTaggedServiceIds('mrtn_json_api.object_mapper.handler'); |
| 125 | 125 | |
| 126 | - $found = []; |
|
| 126 | + $found = [ ]; |
|
| 127 | 127 | |
| 128 | 128 | foreach ($handlers as $id => $tags) |
| 129 | 129 | { |
| 130 | 130 | foreach ($tags as $tag) |
| 131 | 131 | { |
| 132 | - if (! isset($tag['alias'])) { |
|
| 132 | + if (!isset($tag[ 'alias' ])) { |
|
| 133 | 133 | continue; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - $found[$tag['alias']] = $id; |
|
| 136 | + $found[ $tag[ 'alias' ] ] = $id; |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -155,9 +155,9 @@ discard block |
||
| 155 | 155 | { |
| 156 | 156 | $this->createEventDispatcherDecorator($container, $name); |
| 157 | 157 | |
| 158 | - $routes = $this->createRoutesDefinition($definition['resources']); |
|
| 158 | + $routes = $this->createRoutesDefinition($definition[ 'resources' ]); |
|
| 159 | 159 | |
| 160 | - $repository = new Definition($repositoryClass, [$definition['base_url'], $routes]); |
|
| 160 | + $repository = new Definition($repositoryClass, [ $definition[ 'base_url' ], $routes ]); |
|
| 161 | 161 | $repository->setPublic(false); |
| 162 | 162 | |
| 163 | 163 | $client = new Definition($clientClass, [ |
@@ -201,15 +201,15 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | protected function createRoutesDefinition(array $resources): array |
| 203 | 203 | { |
| 204 | - $definition = []; |
|
| 204 | + $definition = [ ]; |
|
| 205 | 205 | |
| 206 | 206 | foreach ($resources as $name => $resource) |
| 207 | 207 | { |
| 208 | - $methods = array_keys($resource['methods']); |
|
| 208 | + $methods = array_keys($resource[ 'methods' ]); |
|
| 209 | 209 | $methods = array_map('strtoupper', $methods); |
| 210 | 210 | |
| 211 | - $definition[$name] = [ |
|
| 212 | - 'path' => trim($resource['path']), |
|
| 211 | + $definition[ $name ] = [ |
|
| 212 | + 'path' => trim($resource[ 'path' ]), |
|
| 213 | 213 | 'methods' => array_map('trim', $methods) |
| 214 | 214 | ]; |
| 215 | 215 | } |