From d382cf35bad3138551bfad957f5db28b3b5d9fb5 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 16 Nov 2021 15:18:59 +0100 Subject: [PATCH] fix: SA: Fix "...Variable in isset() is never defined...." rule. SA stands for Static Analysis. --- phpstan-baseline.neon | 5 ----- .../ChillMainBundle/CRUD/Controller/CRUDController.php | 5 +---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 56aeb1615..5ec4539e8 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -40,11 +40,6 @@ parameters: count: 2 path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php - - - message: "#^Variable \\$entity in isset\\(\\) is never defined\\.$#" - count: 1 - path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php - - message: "#^Chill\\\\MainBundle\\\\CRUD\\\\Routing\\\\CRUDRoutesLoader\\:\\:__construct\\(\\) does not call parent constructor from Symfony\\\\Component\\\\Config\\\\Loader\\\\Loader\\.$#" count: 1 diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php index 762654fbb..94479e233 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php @@ -202,7 +202,6 @@ class CRUDController extends AbstractController * * @param string $action * @param Request $request - * @return type */ protected function indexEntityAction($action, Request $request) { @@ -213,9 +212,7 @@ class CRUDController extends AbstractController return $response; } - if (!isset($entity)) { - $entity = ''; - } + $entity = ''; $response = $this->onPostCheckACL($action, $request, $entity); if ($response instanceof Response) {