From b7f8ba438542a9f6be3ac5e2188e37a2f4a5344c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 21 Feb 2022 00:52:40 +0100 Subject: [PATCH] fix cs --- .../Controller/ThirdPartyController.php | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php index 0f776d809..61797a22c 100644 --- a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php +++ b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php @@ -117,33 +117,6 @@ final class ThirdPartyController extends CRUDController ); } - /** - * @param $action - * @param Request $request - * @param ThirdParty $entity - * @return Response|null - */ - protected function onPostFetchEntity($action, Request $request, $entity): ?Response - { - if ($action === 'view' && $entity->getParent() instanceof ThirdParty) { - $params = [ - 'id' => $entity->getParent()->getId() - ]; - - if ($request->query->has('returnPath')) { - $params['returnPath'] = $request->query->get('returnPath'); - } - - if ($request->query->has('returnLabel')) { - $params['returnLabel'] = $request->query->get('returnLabel'); - } - - return $this->redirectToRoute('chill_crud_3party_3party_view', $params); - } - - return null; - } - protected function onPostCheckACL($action, Request $request, $entity): ?Response { if ('edit' === $action || 'view' === $action) { @@ -167,4 +140,29 @@ final class ThirdPartyController extends CRUDController return null; } + + /** + * @param $action + * @param ThirdParty $entity + */ + protected function onPostFetchEntity($action, Request $request, $entity): ?Response + { + if ('view' === $action && $entity->getParent() instanceof ThirdParty) { + $params = [ + 'id' => $entity->getParent()->getId(), + ]; + + if ($request->query->has('returnPath')) { + $params['returnPath'] = $request->query->get('returnPath'); + } + + if ($request->query->has('returnLabel')) { + $params['returnLabel'] = $request->query->get('returnLabel'); + } + + return $this->redirectToRoute('chill_crud_3party_3party_view', $params); + } + + return null; + } }