@@ -102,7 +102,7 @@ |
||
| 102 | 102 | * @param $config |
| 103 | 103 | * @param $data |
| 104 | 104 | * @param $includes |
| 105 | - * @param $request |
|
| 105 | + * @param \Symfony\Component\HttpFoundation\Request $request |
|
| 106 | 106 | * @return array |
| 107 | 107 | */ |
| 108 | 108 | private function transformResult($config, $data, $includes, $request) |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | throw new \RuntimeException('Transformer key is not set.'); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $config['list'] = (bool)(isset($config['list']) ? $config['list'] : false); |
|
| 60 | + $config['list'] = (bool) (isset($config['list']) ? $config['list'] : false); |
|
| 61 | 61 | |
| 62 | 62 | return $config; |
| 63 | 63 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $limit = $pagination->getLimit(); |
| 83 | 83 | |
| 84 | - $routeGenerator = function ($page) use ($request, $limit) { |
|
| 84 | + $routeGenerator = function($page) use ($request, $limit) { |
|
| 85 | 85 | // Calculation is necessary since requested page is not |
| 86 | 86 | $params = array_merge($request->query->all(), $request->attributes->get('_route_params', array()), array( |
| 87 | 87 | 'limit' => $limit, |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function process(ContainerBuilder $container) |
| 19 | 19 | { |
| 20 | - if (! $container->hasDefinition('alchemy_rest.transformer_registry')) { |
|
| 20 | + if (!$container->hasDefinition('alchemy_rest.transformer_registry')) { |
|
| 21 | 21 | return; |
| 22 | 22 | } |
| 23 | 23 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | protected function configureExceptionListener(array $config, ContainerBuilder $container) |
| 47 | 47 | { |
| 48 | - if (! $config['enabled']) { |
|
| 48 | + if (!$config['enabled']) { |
|
| 49 | 49 | $container->removeDefinition('alchemy_rest.exception_listener'); |
| 50 | 50 | |
| 51 | 51 | return; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | protected function configureDateRequestListener(array $config, ContainerBuilder $container) |
| 68 | 68 | { |
| 69 | - if (! $config['dates']['enabled']) { |
|
| 69 | + if (!$config['dates']['enabled']) { |
|
| 70 | 70 | $container->removeDefinition('alchemy_rest.date_request_listener'); |
| 71 | 71 | |
| 72 | 72 | return; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | protected function configureSortRequestListener(array $config, ContainerBuilder $container) |
| 88 | 88 | { |
| 89 | - if (! $config['sort']['enabled']) { |
|
| 89 | + if (!$config['sort']['enabled']) { |
|
| 90 | 90 | $container->removeDefinition('alchemy_rest.sort_request_listener'); |
| 91 | 91 | |
| 92 | 92 | return; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | protected function configurePaginationRequestListener(array $config, ContainerBuilder $container) |
| 108 | 108 | { |
| 109 | - if (! $config['pagination']['enabled']) { |
|
| 109 | + if (!$config['pagination']['enabled']) { |
|
| 110 | 110 | $container->removeDefinition('alchemy_rest.paginate_request_listener'); |
| 111 | 111 | |
| 112 | 112 | return; |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | $result = $event->getControllerResult(); |
| 17 | 17 | |
| 18 | - if (! $result instanceof BadRequestResult) { |
|
| 18 | + if (!$result instanceof BadRequestResult) { |
|
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | $request = $event->getRequest(); |
| 32 | 32 | $attributes = $request->attributes; |
| 33 | 33 | |
| 34 | - if (! $attributes->has('_dates')) { |
|
| 34 | + if (!$attributes->has('_dates')) { |
|
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $request = $event->getRequest(); |
| 36 | 36 | |
| 37 | - if (! $request->attributes->get('_rest[decode_request]', false, true)) { |
|
| 37 | + if (!$request->attributes->get('_rest[decode_request]', false, true)) { |
|
| 38 | 38 | return; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $jsonBody = $request->getContent(false); |
| 56 | 56 | $decodedBody = json_decode($jsonBody, true); |
| 57 | 57 | |
| 58 | - if (! is_array($decodedBody)) { |
|
| 58 | + if (!is_array($decodedBody)) { |
|
| 59 | 59 | $decodedBody = array(); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -13,13 +13,13 @@ |
||
| 13 | 13 | |
| 14 | 14 | public function onKernelView(GetResponseForControllerResultEvent $event) |
| 15 | 15 | { |
| 16 | - if (! $event->getRequest()->attributes->get('_rest[encode_response]', false, true)) { |
|
| 16 | + if (!$event->getRequest()->attributes->get('_rest[encode_response]', false, true)) { |
|
| 17 | 17 | return; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $result = $event->getControllerResult(); |
| 21 | 21 | |
| 22 | - if (! $result instanceof Response) { |
|
| 22 | + if (!$result instanceof Response) { |
|
| 23 | 23 | if (!is_array($result)) { |
| 24 | 24 | throw new \LogicException('Invalid controller result: array was expected.'); |
| 25 | 25 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | return; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if (! is_array($config)) { |
|
| 37 | + if (!is_array($config)) { |
|
| 38 | 38 | $config = array(); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | $result = $event->getControllerResult(); |
| 18 | 18 | |
| 19 | - if (! $result instanceof RequestAcceptedResult) { |
|
| 19 | + if (!$result instanceof RequestAcceptedResult) { |
|
| 20 | 20 | return; |
| 21 | 21 | } |
| 22 | 22 | |