diff --git a/core/lib/Thelia/Action/Cart.php b/core/lib/Thelia/Action/Cart.php index 5856e22b9..d4f850a1d 100755 --- a/core/lib/Thelia/Action/Cart.php +++ b/core/lib/Thelia/Action/Cart.php @@ -34,7 +34,6 @@ use Thelia\Model\ProductPriceQuery; use Thelia\Model\CartItem; use Thelia\Model\CartItemQuery; use Thelia\Model\ConfigQuery; -use Thelia\Action\Exception\FormValidationException; /** * @@ -53,7 +52,6 @@ class Cart extends BaseAction implements EventSubscriberInterface public function addArticle(CartEvent $event) { - $cart = $event->cart; $newness = $event->newness; $append = $event->append; diff --git a/core/lib/Thelia/Action/Exception/ActionException.php b/core/lib/Thelia/Action/Exception/ActionException.php deleted file mode 100644 index 92f69c3b9..000000000 --- a/core/lib/Thelia/Action/Exception/ActionException.php +++ /dev/null @@ -1,28 +0,0 @@ -. */ -/* */ -/*************************************************************************************/ -namespace Thelia\Action\Exception; - -class ActionException extends \RuntimeException -{ - -} diff --git a/core/lib/Thelia/Config/Resources/routing/front.xml b/core/lib/Thelia/Config/Resources/routing/front.xml index 87adbe32f..ad42d42cf 100644 --- a/core/lib/Thelia/Config/Resources/routing/front.xml +++ b/core/lib/Thelia/Config/Resources/routing/front.xml @@ -21,6 +21,7 @@ Thelia\Controller\Front\CartController::addArticle + cart diff --git a/core/lib/Thelia/Controller/BaseController.php b/core/lib/Thelia/Controller/BaseController.php index 9d8daac36..5c6e3eb5e 100755 --- a/core/lib/Thelia/Controller/BaseController.php +++ b/core/lib/Thelia/Controller/BaseController.php @@ -33,7 +33,7 @@ use Thelia\Core\Event\ActionEvent; use Symfony\Component\EventDispatcher\EventDispatcher; use Thelia\Core\Factory\ActionEventFactory; use Thelia\Form\BaseForm; -use Thelia\Action\Exception\FormValidationException; +use Thelia\Form\Exception\FormValidationException; /** * diff --git a/core/lib/Thelia/Controller/Front/CartController.php b/core/lib/Thelia/Controller/Front/CartController.php index 9b988ab15..4c00a280b 100644 --- a/core/lib/Thelia/Controller/Front/CartController.php +++ b/core/lib/Thelia/Controller/Front/CartController.php @@ -23,7 +23,7 @@ namespace Thelia\Controller\Front; use Propel\Runtime\Exception\PropelException; -use Thelia\Action\Exception\FormValidationException; +use Thelia\Form\Exception\FormValidationException; use Thelia\Core\Event\CartEvent; use Thelia\Core\Event\TheliaEvents; use Symfony\Component\HttpFoundation\Request; @@ -54,10 +54,10 @@ class CartController extends BaseFrontController $this->redirectSuccess(); - } catch(PropelException $e) { + } catch (PropelException $e) { \Thelia\Log\Tlog::getInstance()->error(sprintf("Failed to add item to cart with message : %s", $e->getMessage())); $message = "Failed to add this article to your cart, please try again"; - } catch(FormValidationException $e) { + } catch (FormValidationException $e) { $message = $e->getMessage(); } diff --git a/core/lib/Thelia/Core/Event/CartEvent.php b/core/lib/Thelia/Core/Event/CartEvent.php index 8cb072f12..4dc6d9d67 100644 --- a/core/lib/Thelia/Core/Event/CartEvent.php +++ b/core/lib/Thelia/Core/Event/CartEvent.php @@ -24,7 +24,6 @@ namespace Thelia\Core\Event; use Symfony\Component\EventDispatcher\Event; -use Thelia\Core\HttpFoundation\Request; use Thelia\Model\Cart; class CartEvent extends Event diff --git a/core/lib/Thelia/Form/CartAdd.php b/core/lib/Thelia/Form/CartAdd.php index d738ab0f7..25ca9ce57 100644 --- a/core/lib/Thelia/Form/CartAdd.php +++ b/core/lib/Thelia/Form/CartAdd.php @@ -24,8 +24,8 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\ExecutionContextInterface; -use Thelia\Action\Exception\StockNotFoundException; -use Thelia\Action\Exception\ProductNotFoundException; +use Thelia\Form\Exception\StockNotFoundException; +use Thelia\Form\Exception\ProductNotFoundException; use Thelia\Model\ProductSaleElementsQuery; use Thelia\Model\ConfigQuery; use Thelia\Model\ProductQuery; diff --git a/core/lib/Thelia/Action/Exception/FormValidationException.php b/core/lib/Thelia/Form/Exception/FormValidationException.php similarity index 95% rename from core/lib/Thelia/Action/Exception/FormValidationException.php rename to core/lib/Thelia/Form/Exception/FormValidationException.php index 29626a01f..c955b03f0 100644 --- a/core/lib/Thelia/Action/Exception/FormValidationException.php +++ b/core/lib/Thelia/Form/Exception/FormValidationException.php @@ -21,8 +21,8 @@ /* */ /*************************************************************************************/ -namespace Thelia\Action\Exception; +namespace Thelia\Form\Exception; -class FormValidationException extends ActionException +class FormValidationException extends \RuntimeException { } diff --git a/core/lib/Thelia/Action/Exception/ProductNotFoundException.php b/core/lib/Thelia/Form/Exception/ProductNotFoundException.php similarity index 95% rename from core/lib/Thelia/Action/Exception/ProductNotFoundException.php rename to core/lib/Thelia/Form/Exception/ProductNotFoundException.php index 4bb6ac43e..480aec433 100644 --- a/core/lib/Thelia/Action/Exception/ProductNotFoundException.php +++ b/core/lib/Thelia/Form/Exception/ProductNotFoundException.php @@ -21,8 +21,8 @@ /* */ /*************************************************************************************/ -namespace Thelia\Action\Exception; +namespace Thelia\Form\Exception; -class ProductNotFoundException extends ActionException +class ProductNotFoundException extends FormValidationException { } diff --git a/core/lib/Thelia/Action/Exception/StockNotFoundException.php b/core/lib/Thelia/Form/Exception/StockNotFoundException.php similarity index 95% rename from core/lib/Thelia/Action/Exception/StockNotFoundException.php rename to core/lib/Thelia/Form/Exception/StockNotFoundException.php index 98a316450..47c5740da 100644 --- a/core/lib/Thelia/Action/Exception/StockNotFoundException.php +++ b/core/lib/Thelia/Form/Exception/StockNotFoundException.php @@ -21,9 +21,9 @@ /* */ /*************************************************************************************/ -namespace Thelia\Action\Exception; +namespace Thelia\Form\Exception; -class StockNotFoundException extends ActionException +class StockNotFoundException extends FormValidationException { }