Skip to content

Commit 6325c8d

Browse files
committed
fixed psr2 style issues
1 parent 320a215 commit 6325c8d

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

Routing/ElasticsearchLoader.php

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,30 +62,39 @@ public function supports($resource, $type = null)
6262
* Create route for REST action
6363
*
6464
* @param RouteCollection $collection
65-
* @param string $document
66-
* @param array $endpoint
67-
* @param string $version
65+
* @param string $document
66+
* @param array $endpoint
67+
* @param string $version
6868
*/
6969
private function processRestRoute(
7070
$collection,
7171
$document,
7272
$endpoint,
7373
$version = 'v1'
7474
) {
75+
7576
$defaults = [
7677
'_documentId' => null,
7778
'_endpoint' => $endpoint,
7879
'_version' => $version,
7980
'repository' => $endpoint['repository'],
8081
];
8182

82-
$pattern = $version.'/'.sprintf('%s/{documentId}', strtolower($document));
83+
$pattern = $version . '/' . sprintf('%s/{documentId}', strtolower($document));
8384

8485
if ($endpoint['batch']) {
8586
$defaults['_controller'] = 'ONGRApiBundle:Batch:Process';
86-
$batchPattern = $version.'/'.sprintf('%s', strtolower($document)) . '/_batch';
87+
$batchPattern = $version . '/' . sprintf('%s', strtolower($document)) . '/_batch';
8788
$name = strtolower(sprintf('ongr_api_%s_%s_%s', $version, $document, Request::METHOD_POST));
88-
$collection->add($name.'_batch', new Route($batchPattern, $defaults, [], [], "", [], [Request::METHOD_POST]));
89+
$collection->add($name . '_batch', new Route(
90+
$batchPattern,
91+
$defaults,
92+
[],
93+
[],
94+
"",
95+
[],
96+
[Request::METHOD_POST]
97+
));
8998
}
9099

91100
foreach ($endpoint['methods'] as $method) {
@@ -94,8 +103,8 @@ private function processRestRoute(
94103
$defaults['_controller'] = sprintf('ONGRApiBundle:Rest:%s', strtolower($method));
95104

96105
if ($method == Request::METHOD_POST) {
97-
$postPattern = $version.'/'.sprintf('%s', strtolower($document));
98-
$collection->add($name.'_wi', new Route($postPattern, $defaults, [], [], "", [], [$method]));
106+
$postPattern = $version . '/' . sprintf('%s', strtolower($document));
107+
$collection->add($name . '_wi', new Route($postPattern, $defaults, [], [], "", [], [$method]));
99108
}
100109

101110
$collection->add($name, new Route($pattern, $defaults, [], [], "", [], [$method]));
@@ -104,15 +113,15 @@ private function processRestRoute(
104113
$defaults['_controller'] = sprintf('ONGRApiBundle:Variant:%s', strtolower($method));
105114

106115
if ($method == Request::METHOD_POST || $method == Request::METHOD_GET) {
107-
$variantPattern = $pattern. '/_variant';
116+
$variantPattern = $pattern . '/_variant';
108117
$collection->add(
109-
$name.'_variant_wi',
118+
$name . '_variant_wi',
110119
new Route($variantPattern, $defaults, [], [], "", [], [$method])
111120
);
112121
}
113122

114-
$variantPattern = $pattern. '/_variant/{variantId}';
115-
$collection->add($name.'_variant', new Route($variantPattern, $defaults, [], [], "", [], [$method]));
123+
$variantPattern = $pattern . '/_variant/{variantId}';
124+
$collection->add($name . '_variant', new Route($variantPattern, $defaults, [], [], "", [], [$method]));
116125
}
117126
}
118127
}

0 commit comments

Comments
 (0)