From d9a48ea71468fcbbd1b9fd611e53bfe895318fa3 Mon Sep 17 00:00:00 2001 From: cbeauvoi Date: Wed, 17 Jul 2019 18:01:53 +0200 Subject: [PATCH] renew class run --- BillingBundle/Controller/BillingController.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/BillingBundle/Controller/BillingController.php b/BillingBundle/Controller/BillingController.php index df0a36c..cbbe6db 100644 --- a/BillingBundle/Controller/BillingController.php +++ b/BillingBundle/Controller/BillingController.php @@ -37,17 +37,9 @@ class BillingController extends AbstractController list($service, $function) = explode('::', $serviceToCall); - $srv = null; + $srv = new $service(); - if (class_exists($service)) - $srv = new $service(); - else - $this->logger->error("Can't find your class to redirect webhook"); - - if (method_exists($srv, $function)) - $srv->{$function}($session); - else - $this->logger->error("Can't find your method in class " . $service); + $srv->{$function}($session); return $this->json("OK", 200); }