From 5beefc5857dc572c7d8e09c4135de0d4ebe870c9 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:27:39 +0200 Subject: [PATCH 1/5] add missing use --- core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php b/core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php index caa446cd7..957114ffb 100644 --- a/core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php +++ b/core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php @@ -11,6 +11,7 @@ /*************************************************************************************/ namespace Thelia\Coupon\Type; +use Thelia\Core\Translation\Translator; /** * A trait to manage a coupon which removes a percentage of cart items from the order total. From a00a23e49561c64150a0b107e85b1a97908d819a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:29:17 +0200 Subject: [PATCH 2/5] remove unused use statement --- core/lib/Thelia/Controller/Admin/CouponController.php | 1 - core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php | 1 - 2 files changed, 2 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/CouponController.php b/core/lib/Thelia/Controller/Admin/CouponController.php index 06f81aaaa..370b504c1 100644 --- a/core/lib/Thelia/Controller/Admin/CouponController.php +++ b/core/lib/Thelia/Controller/Admin/CouponController.php @@ -14,7 +14,6 @@ namespace Thelia\Controller\Admin; use Symfony\Component\Form\Form; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Router; use Thelia\Condition\ConditionFactory; diff --git a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php index ae2312aae..9b3a979da 100644 --- a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php @@ -14,7 +14,6 @@ namespace Thelia\Core\Event\Coupon; use Thelia\Core\Event\ActionEvent; use Thelia\Condition\ConditionCollection; use Thelia\Model\Coupon; -use Thelia\Model\Exception\InvalidArgumentException; /** * Occurring when a Coupon is created or updated From 77a4c45aa4927e45a6d20bd3afe1e4ed5fb848c4 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:30:46 +0200 Subject: [PATCH 3/5] remove commented code --- .../lib/Thelia/Controller/Admin/TranslationsController.php | 7 ------- core/lib/Thelia/Coupon/Type/FreeProduct.php | 4 ---- 2 files changed, 11 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/TranslationsController.php b/core/lib/Thelia/Controller/Admin/TranslationsController.php index 93aab31cb..6c2aed749 100644 --- a/core/lib/Thelia/Controller/Admin/TranslationsController.php +++ b/core/lib/Thelia/Controller/Admin/TranslationsController.php @@ -181,13 +181,6 @@ class TranslationsController extends BaseAdminController case 'ma' : $template = new TemplateDefinition($item_name, TemplateDefinition::EMAIL); break; - - default: - /* - throw new \InvalidArgumentException( - $this->getTranslator()->trans("Undefined translation type: %item", ['%item' => $item_to_translate]) - ); - */ } if ($template) { diff --git a/core/lib/Thelia/Coupon/Type/FreeProduct.php b/core/lib/Thelia/Coupon/Type/FreeProduct.php index 5fe65b1b0..42a106f4e 100644 --- a/core/lib/Thelia/Coupon/Type/FreeProduct.php +++ b/core/lib/Thelia/Coupon/Type/FreeProduct.php @@ -230,10 +230,6 @@ class FreeProduct extends AbstractRemoveOnProducts $this->setRelatedCartItem($eligibleProduct, $cartEvent->getCartItem()->getId()); $freeProductCartItem = $cartEvent->getCartItem(); - - // Setting product price is dangerous, as the customer could change the ordered quantity of this product. - // We will instead add the product price to the order discount. - // $cartEvent->getCartItem()->setPrice(0)->save(); } } From 84c2432507c9eeed42d026c35fcd75662b187d03 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:38:43 +0200 Subject: [PATCH 4/5] remove unused variable --- core/lib/Thelia/Config/Resources/routing/admin.xml | 2 +- .../lib/Thelia/Controller/Admin/CustomerExportController.php | 2 +- core/lib/Thelia/Core/Template/Loop/Category.php | 3 --- core/lib/Thelia/Core/Template/Loop/Coupon.php | 3 --- core/lib/Thelia/Core/Template/Loop/Folder.php | 3 --- core/lib/Thelia/Coupon/Type/FreeProduct.php | 3 --- core/lib/Thelia/Tools/FileManager.php | 5 +++-- 7 files changed, 5 insertions(+), 16 deletions(-) diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml index b438c10e0..6b5622ff8 100644 --- a/core/lib/Thelia/Config/Resources/routing/admin.xml +++ b/core/lib/Thelia/Config/Resources/routing/admin.xml @@ -1165,7 +1165,7 @@ - Thelia\Controller\Admin\CustomerExportController::NewsletterExportAction + Thelia\Controller\Admin\CustomerExportController::newsletterExportAction diff --git a/core/lib/Thelia/Controller/Admin/CustomerExportController.php b/core/lib/Thelia/Controller/Admin/CustomerExportController.php index 5e9900dba..0036f2d53 100644 --- a/core/lib/Thelia/Controller/Admin/CustomerExportController.php +++ b/core/lib/Thelia/Controller/Admin/CustomerExportController.php @@ -25,7 +25,7 @@ use Thelia\Model\NewsletterQuery; class CustomerExportController extends BaseAdminController { - public function NewsletterExportAction() + public function newsletterExportAction() { if (null !== $response = $this->checkAuth([AdminResources::EXPORT_CUSTOMER_NEWSLETTER], [], [AccessManager::VIEW])) { return $response; diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index 90b54e3fd..9ecee9182 100644 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -190,9 +190,6 @@ class Category extends BaseI18nLoop implements PropelSearchLoopInterface, Search } } - /* @todo */ - $notEmpty = $this->getNot_empty(); - return $search; } diff --git a/core/lib/Thelia/Core/Template/Loop/Coupon.php b/core/lib/Thelia/Core/Template/Loop/Coupon.php index c46739aa9..310a760e2 100644 --- a/core/lib/Thelia/Core/Template/Loop/Coupon.php +++ b/core/lib/Thelia/Core/Template/Loop/Coupon.php @@ -152,9 +152,6 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface /** @var ConditionFactory $conditionFactory */ $conditionFactory = $this->container->get('thelia.condition.factory'); - /** @var Request $request */ - $request = $this->container->get('request'); - /** @var MCoupon $coupon */ foreach ($loopResult->getResultDataCollection() as $coupon) { diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index 618c411e3..ee4e0cbbe 100644 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -157,9 +157,6 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface, SearchLo } } - /* @todo */ - $notEmpty = $this->getNot_empty(); - return $search; } diff --git a/core/lib/Thelia/Coupon/Type/FreeProduct.php b/core/lib/Thelia/Coupon/Type/FreeProduct.php index 42a106f4e..3032813a8 100644 --- a/core/lib/Thelia/Coupon/Type/FreeProduct.php +++ b/core/lib/Thelia/Coupon/Type/FreeProduct.php @@ -234,9 +234,6 @@ class FreeProduct extends AbstractRemoveOnProducts } if ($freeProductCartItem instanceof CartItem) { - - $taxCountry = $this->facade->getDeliveryCountry(); - // The discount is the product price. $discount = $freeProductCartItem->getPromo() ? $freeProductCartItem->getPromoPrice() : $freeProductCartItem->getPrice(); diff --git a/core/lib/Thelia/Tools/FileManager.php b/core/lib/Thelia/Tools/FileManager.php index 351283d8c..caf8fe61f 100644 --- a/core/lib/Thelia/Tools/FileManager.php +++ b/core/lib/Thelia/Tools/FileManager.php @@ -95,10 +95,11 @@ class FileManager if (!$model->save()) { throw new ImageException( sprintf( - '%s %s (%s) failed to be saved (image file)', + '%s %s (%s) with id %d failed to be saved (image file)', ucfirst($parentType), $model->getFile(), - $fileType + $fileType, + $parentId ) ); } From 35d13885ab357a87884c7f1bb0fce7d0711b3983 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:45:48 +0200 Subject: [PATCH 5/5] remove unused variable --- core/lib/Thelia/Condition/Implementation/StartDate.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/lib/Thelia/Condition/Implementation/StartDate.php b/core/lib/Thelia/Condition/Implementation/StartDate.php index 2524e1b6d..d086fb39a 100644 --- a/core/lib/Thelia/Condition/Implementation/StartDate.php +++ b/core/lib/Thelia/Condition/Implementation/StartDate.php @@ -127,10 +127,6 @@ class StartDate extends ConditionAbstract */ public function getSummary() { - $i18nOperator = Operators::getI18n( - $this->translator, $this->operators[self::START_DATE] - ); - $date = new \DateTime(); $date->setTimestamp($this->values[self::START_DATE]); $strDate = $date->format($this->getDateFormat());