From 9d0121f32162f0449155ea06fff3c7169c3864a9 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 10 Jan 2014 11:41:55 +0100 Subject: [PATCH] fix cs --- core/lib/Thelia/Action/Cart.php | 8 ++-- core/lib/Thelia/Action/Coupon.php | 4 +- core/lib/Thelia/Action/Order.php | 1 - core/lib/Thelia/Command/UpdateCommand.php | 6 +-- .../Thelia/Condition/ConditionCollection.php | 3 +- .../Thelia/Condition/ConditionEvaluator.php | 4 +- .../lib/Thelia/Condition/ConditionFactory.php | 7 +-- .../Thelia/Condition/ConditionOrganizer.php | 2 +- .../Condition/ConditionOrganizerInterface.php | 2 +- .../Implementation/ConditionAbstract.php | 6 +-- .../Implementation/ConditionInterface.php | 4 +- .../Implementation/MatchForEveryone.php | 3 +- .../Implementation/MatchForTotalAmount.php | 5 +- .../Implementation/MatchForXArticles.php | 1 + core/lib/Thelia/Condition/Operators.php | 2 +- .../Controller/Admin/CouponController.php | 2 +- .../Coupon/CouponCreateOrUpdateEvent.php | 8 ++-- .../Template/Assets/AssetManagerInterface.php | 25 +++++----- .../Template/Assets/AsseticAssetManager.php | 47 +++++++++---------- core/lib/Thelia/Core/Template/Loop/Cart.php | 1 - .../Thelia/Core/Template/Loop/OrderCoupon.php | 3 -- .../lib/Thelia/Core/Template/Loop/Product.php | 1 - .../Template/Loop/ProductSaleElements.php | 1 - .../Thelia/Core/Template/Loop/Template.php | 10 +--- .../Thelia/Core/Template/ParserInterface.php | 15 +++--- .../Smarty/Assets/SmartyAssetsManager.php | 13 +++-- .../Core/Template/Smarty/SmartyParser.php | 40 +++++++--------- .../Core/Template/TemplateDefinition.php | 21 ++++++--- .../Thelia/Core/Template/TemplateHelper.php | 13 ++--- core/lib/Thelia/Core/Thelia.php | 29 ++++++------ core/lib/Thelia/Coupon/BaseFacade.php | 7 +-- core/lib/Thelia/Coupon/CouponFactory.php | 4 +- core/lib/Thelia/Coupon/CouponManager.php | 5 +- core/lib/Thelia/Coupon/FacadeInterface.php | 6 +-- .../lib/Thelia/Coupon/Type/CouponAbstract.php | 15 ++---- .../Thelia/Coupon/Type/CouponInterface.php | 10 ++-- .../lib/Thelia/Coupon/Type/RemoveXPercent.php | 9 ++-- .../Form/MailingSystemModificationForm.php | 1 - core/lib/Thelia/Install/BaseInstall.php | 3 +- .../Install/CheckDatabaseConnection.php | 4 -- core/lib/Thelia/Install/CheckPermission.php | 10 +--- core/lib/Thelia/Install/Database.php | 3 +- .../Exception/AlreadyInstallException.php | 3 +- .../Install/Exception/InstallException.php | 2 +- .../Install/Exception/UpToDateException.php | 3 +- core/lib/Thelia/Install/Update.php | 9 ++-- core/lib/Thelia/Mailer/MailerFactory.php | 10 ++-- .../Thelia/Rewriting/RewritingResolver.php | 15 ++---- .../Thelia/Rewriting/RewritingRetriever.php | 17 ++++--- core/lib/Thelia/TaxEngine/Calculator.php | 47 +++++++++---------- core/lib/Thelia/TaxEngine/TaxEngine.php | 14 +++--- .../Thelia/TaxEngine/TaxType/BaseTaxType.php | 22 ++++----- .../TaxType/FeatureFixAmountTaxType.php | 2 +- .../Thelia/Tests/Coupon/CouponFactoryTest.php | 2 - 54 files changed, 220 insertions(+), 290 deletions(-) diff --git a/core/lib/Thelia/Action/Cart.php b/core/lib/Thelia/Action/Cart.php index 36ab41385..c1abd3034 100755 --- a/core/lib/Thelia/Action/Cart.php +++ b/core/lib/Thelia/Action/Cart.php @@ -186,11 +186,11 @@ class Cart extends BaseAction implements EventSubscriberInterface /** * try to attach a new item to an existing cart * - * @param \Thelia\Model\Cart $cart - * @param int $productId + * @param \Thelia\Model\Cart $cart + * @param int $productId * @param \Thelia\Model\ProductSaleElements $productSaleElements - * @param float $quantity - * @param ProductPrice $productPrice + * @param float $quantity + * @param ProductPrice $productPrice * * @return CartItem */ diff --git a/core/lib/Thelia/Action/Coupon.php b/core/lib/Thelia/Action/Coupon.php index 8883cb27c..2bffb19ee 100755 --- a/core/lib/Thelia/Action/Coupon.php +++ b/core/lib/Thelia/Action/Coupon.php @@ -211,7 +211,7 @@ class Coupon extends BaseAction implements EventSubscriberInterface /** @var CouponManager $couponManager */ $couponManager = $this->container->get('thelia.coupon.manager'); - if($couponManager->isCouponRemovingPostage()) { + if ($couponManager->isCouponRemovingPostage()) { $order = $event->getOrder(); $order->setPostage(0); @@ -235,7 +235,7 @@ class Coupon extends BaseAction implements EventSubscriberInterface $consumedCoupons = $request->getSession()->getConsumedCoupons(); if (is_array($consumedCoupons)) { - foreach($consumedCoupons as $couponCode) { + foreach ($consumedCoupons as $couponCode) { $couponQuery = CouponQuery::create(); $couponModel = $couponQuery->findOneByCode($couponCode); $couponModel->setLocale($request->getSession()->getLang()->getLocale()); diff --git a/core/lib/Thelia/Action/Order.php b/core/lib/Thelia/Action/Order.php index 9d7daaba7..792297642 100755 --- a/core/lib/Thelia/Action/Order.php +++ b/core/lib/Thelia/Action/Order.php @@ -30,7 +30,6 @@ use Thelia\Core\Event\Cart\CartEvent; use Thelia\Core\Event\Order\OrderAddressEvent; use Thelia\Core\Event\Order\OrderEvent; use Thelia\Core\Event\TheliaEvents; -use Thelia\Coupon\CouponManager; use Thelia\Exception\TheliaProcessException; use Thelia\Model\AddressQuery; use Thelia\Model\ConfigQuery; diff --git a/core/lib/Thelia/Command/UpdateCommand.php b/core/lib/Thelia/Command/UpdateCommand.php index 745a1b219..36f9aacb9 100644 --- a/core/lib/Thelia/Command/UpdateCommand.php +++ b/core/lib/Thelia/Command/UpdateCommand.php @@ -27,8 +27,6 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Thelia\Install\Exception\UpToDateException; use Thelia\Install\Update; -use Thelia\Model\ConfigQuery; - /** * Class UpdateCommand @@ -65,7 +63,7 @@ class UpdateCommand extends ContainerAwareCommand 'Your database is updated successfully !', '' )); - } catch(PropelException $e) { + } catch (PropelException $e) { $errorMsg = $e->getMessage(); $output->writeln(array( @@ -81,4 +79,4 @@ class UpdateCommand extends ContainerAwareCommand )); } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Condition/ConditionCollection.php b/core/lib/Thelia/Condition/ConditionCollection.php index be457bded..bedf5b337 100644 --- a/core/lib/Thelia/Condition/ConditionCollection.php +++ b/core/lib/Thelia/Condition/ConditionCollection.php @@ -26,7 +26,6 @@ namespace Thelia\Condition; use ArrayAccess; use Countable; use Iterator; -use Symfony\Component\DependencyInjection\ContainerInterface; use Thelia\Condition\Implementation\ConditionInterface; /** @@ -201,4 +200,4 @@ class ConditionCollection implements Iterator, Countable, ArrayAccess return json_encode($arrayToSerialize); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Condition/ConditionEvaluator.php b/core/lib/Thelia/Condition/ConditionEvaluator.php index 901a9161a..dd606fcd0 100644 --- a/core/lib/Thelia/Condition/ConditionEvaluator.php +++ b/core/lib/Thelia/Condition/ConditionEvaluator.php @@ -23,12 +23,10 @@ namespace Thelia\Condition; -use Symfony\Component\DependencyInjection\ContainerInterface; use Thelia\Condition\Implementation\ConditionInterface; use Thelia\Condition\Operators; use Thelia\Condition\ConditionCollection; - /** * Validate Conditions * @@ -138,4 +136,4 @@ class ConditionEvaluator return false; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Condition/ConditionFactory.php b/core/lib/Thelia/Condition/ConditionFactory.php index 431641659..72079fcc7 100644 --- a/core/lib/Thelia/Condition/ConditionFactory.php +++ b/core/lib/Thelia/Condition/ConditionFactory.php @@ -28,7 +28,6 @@ use Thelia\Condition\Implementation\ConditionInterface; use Thelia\Coupon\FacadeInterface; use Thelia\Condition\ConditionCollection; - /** * Manage how Condition could interact with the current application state (Thelia) * @@ -114,7 +113,6 @@ class ConditionFactory return $collection; } - /** * Build a Condition from form * @@ -123,7 +121,7 @@ class ConditionFactory * @param array $values Values setting this Condition * * @throws \InvalidArgumentException - * @return ConditionInterface Ready to use Condition or false + * @return ConditionInterface Ready to use Condition or false */ public function build($conditionServiceId, array $operators, array $values) { @@ -166,7 +164,6 @@ class ConditionFactory */ public function getInputsFromConditionInterface(ConditionInterface $condition) { - return $condition->getValidators(); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Condition/ConditionOrganizer.php b/core/lib/Thelia/Condition/ConditionOrganizer.php index ebcff5f7d..6dab6e92c 100644 --- a/core/lib/Thelia/Condition/ConditionOrganizer.php +++ b/core/lib/Thelia/Condition/ConditionOrganizer.php @@ -44,4 +44,4 @@ class ConditionOrganizer implements ConditionOrganizerInterface // @todo: Implement organize() method. } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Condition/ConditionOrganizerInterface.php b/core/lib/Thelia/Condition/ConditionOrganizerInterface.php index b34982cc7..ab5a9dff7 100644 --- a/core/lib/Thelia/Condition/ConditionOrganizerInterface.php +++ b/core/lib/Thelia/Condition/ConditionOrganizerInterface.php @@ -40,4 +40,4 @@ interface ConditionOrganizerInterface * @return array Array of ConditionInterface sorted */ public function organize(array $conditions); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Condition/Implementation/ConditionAbstract.php b/core/lib/Thelia/Condition/Implementation/ConditionAbstract.php index ab0b404b3..48ec8ed1e 100644 --- a/core/lib/Thelia/Condition/Implementation/ConditionAbstract.php +++ b/core/lib/Thelia/Condition/Implementation/ConditionAbstract.php @@ -171,7 +171,6 @@ abstract class ConditionAbstract implements ConditionInterface return $serializableCondition; } - /** * Check if currency if valid or not * @@ -232,7 +231,7 @@ abstract class ConditionAbstract implements ConditionInterface $selectHtml = ''; $optionHtml = ''; $inputs = $this->getValidators(); - if(isset($inputs['inputs'][$inputKey])) { + if (isset($inputs['inputs'][$inputKey])) { $operators = $inputs['inputs'][$inputKey]['availableOperators']; foreach ($operators as $key => $operator) { $selected = ''; @@ -282,6 +281,7 @@ abstract class ConditionAbstract implements ConditionInterface '; + return $html; } @@ -316,4 +316,4 @@ abstract class ConditionAbstract implements ConditionInterface return $selectHtml; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Condition/Implementation/ConditionInterface.php b/core/lib/Thelia/Condition/Implementation/ConditionInterface.php index a123d2c10..0b4f3efe0 100644 --- a/core/lib/Thelia/Condition/Implementation/ConditionInterface.php +++ b/core/lib/Thelia/Condition/Implementation/ConditionInterface.php @@ -24,7 +24,6 @@ namespace Thelia\Condition\Implementation; use Thelia\Condition\SerializableCondition; -use Thelia\Core\Translation\Translator; use Thelia\Coupon\FacadeInterface; /** @@ -41,7 +40,7 @@ interface ConditionInterface * * @param FacadeInterface $adapter Service adapter */ - function __construct(FacadeInterface $adapter); + public function __construct(FacadeInterface $adapter); /** * Get Condition Service id @@ -75,7 +74,6 @@ interface ConditionInterface */ public function getAvailableOperators(); - /** * Get I18n name * diff --git a/core/lib/Thelia/Condition/Implementation/MatchForEveryone.php b/core/lib/Thelia/Condition/Implementation/MatchForEveryone.php index e3452a830..48b7c250b 100644 --- a/core/lib/Thelia/Condition/Implementation/MatchForEveryone.php +++ b/core/lib/Thelia/Condition/Implementation/MatchForEveryone.php @@ -148,8 +148,7 @@ class MatchForEveryone extends ConditionAbstract public function drawBackOfficeInputs() { // No input - return ''; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php b/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php index 4ffe2ebd4..7cbdd32df 100644 --- a/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php +++ b/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php @@ -23,7 +23,6 @@ namespace Thelia\Condition\Implementation; -use Symfony\Component\Intl\Exception\NotImplementedException; use Thelia\Condition\Implementation\ConditionAbstract; use Thelia\Condition\Operators; use Thelia\Exception\InvalidConditionOperatorException; @@ -119,10 +118,8 @@ class MatchForTotalAmount extends ConditionAbstract $this->isPriceValid($priceValue); - $this->isCurrencyValid($currencyValue); - $this->operators = array( self::INPUT1 => $priceOperator, self::INPUT2 => $currencyOperator, @@ -335,4 +332,4 @@ class MatchForTotalAmount extends ConditionAbstract return $selectHtml; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Condition/Implementation/MatchForXArticles.php b/core/lib/Thelia/Condition/Implementation/MatchForXArticles.php index 2d2df9c14..f1123b57b 100644 --- a/core/lib/Thelia/Condition/Implementation/MatchForXArticles.php +++ b/core/lib/Thelia/Condition/Implementation/MatchForXArticles.php @@ -247,6 +247,7 @@ class MatchForXArticles extends ConditionAbstract '; + return $html; } diff --git a/core/lib/Thelia/Condition/Operators.php b/core/lib/Thelia/Condition/Operators.php index cc687acde..b6a8816ba 100644 --- a/core/lib/Thelia/Condition/Operators.php +++ b/core/lib/Thelia/Condition/Operators.php @@ -124,4 +124,4 @@ abstract class Operators return $ret; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Controller/Admin/CouponController.php b/core/lib/Thelia/Controller/Admin/CouponController.php index 275f9b5de..68508903e 100755 --- a/core/lib/Thelia/Controller/Admin/CouponController.php +++ b/core/lib/Thelia/Controller/Admin/CouponController.php @@ -314,7 +314,6 @@ class CouponController extends BaseAdminController /** @var ConditionInterface $condition */ $condition = $this->container->get($conditionId); - if ($inputs === null) { return $this->pageNotFound(); } @@ -723,6 +722,7 @@ class CouponController extends BaseAdminController $args = array(); $args['conditions'] = $this->cleanConditionForTemplate($couponManager->getConditions()); + return $this->render('coupon/conditions', $args); } diff --git a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php index de236ac3c..376db1d3f 100644 --- a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php @@ -87,10 +87,10 @@ class CouponCreateOrUpdateEvent extends ActionEvent /** * Constructor * - * @param string $code Coupon Code - * @param string $serviceId Coupon Service id - * @param string $title Coupon title - * @param array $effects Coupon effects ready to be serialized + * @param string $code Coupon Code + * @param string $serviceId Coupon Service id + * @param string $title Coupon title + * @param array $effects Coupon effects ready to be serialized * 'amount' key is mandatory and reflects * the amount deduced from the cart * @param string $shortDescription Coupon short description diff --git a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php index 09a7acd8d..dedb54d8e 100644 --- a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php +++ b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php @@ -23,7 +23,8 @@ namespace Thelia\Core\Template\Assets; -interface AssetManagerInterface { +interface AssetManagerInterface +{ /** * Prepare an asset directory by checking that no changes occured in * the source directory. If any change is detected, the whole asset directory @@ -45,23 +46,23 @@ interface AssetManagerInterface { /** * Generates assets from $asset_path in $output_path, using $filters. * - * @param $assetSource - * @param $assetDirectoryBase - * @param string $webAssetsDirectoryBase the full path to the asset file (or file collection, e.g. *.less) + * @param $assetSource + * @param $assetDirectoryBase + * @param string $webAssetsDirectoryBase the full path to the asset file (or file collection, e.g. *.less) * - * @param string $webAssetsTemplate the full disk path to the base assets output directory in the web space - * @param $webAssetsKey - * @param string $outputUrl the URL to the base assets output directory in the web space + * @param string $webAssetsTemplate the full disk path to the base assets output directory in the web space + * @param $webAssetsKey + * @param string $outputUrl the URL to the base assets output directory in the web space * - * @param string $assetType the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. - * @param array $filters a list of filters, as defined below (see switch($filter_name) ...) + * @param string $assetType the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. + * @param array $filters a list of filters, as defined below (see switch($filter_name) ...) * - * @param boolean $debug true / false + * @param boolean $debug true / false * * @internal param string $web_assets_directory_base the full disk path to the base assets output directory in the web space * @internal param string $output_url the URL to the base assets output directory in the web space * - * @return string The URL to the generated asset file. + * @return string The URL to the generated asset file. */ public function processAsset($assetSource, $assetDirectoryBase, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey, $outputUrl, $assetType, $filters, $debug); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php index 16f6c67c7..bca1ce1c7 100755 --- a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php +++ b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php @@ -51,7 +51,7 @@ class AsseticAssetManager implements AssetManagerInterface /** * Create a stamp form the modification time of the content of the given directory and all of its subdirectories * - * @param string $directory ther directory name + * @param string $directory ther directory name * @return string the stamp of this directory */ protected function getStamp($directory) @@ -76,7 +76,8 @@ class AsseticAssetManager implements AssetManagerInterface * * @return bool */ - protected function isSourceFile(\SplFileInfo $fileInfo) { + protected function isSourceFile(\SplFileInfo $fileInfo) + { return in_array($fileInfo->getExtension(), $this->source_file_extensions); } @@ -84,9 +85,9 @@ class AsseticAssetManager implements AssetManagerInterface * Recursively copy assets from the source directory to the destination * directory in the web space, omitting source files. * - * @param Filesystem $fs - * @param string $from_directory the source - * @param string $to_directory the destination + * @param Filesystem $fs + * @param string $from_directory the source + * @param string $to_directory the destination * @throws \RuntimeException if a problem occurs. */ protected function copyAssets(Filesystem $fs, $from_directory, $to_directory) @@ -205,8 +206,7 @@ class AsseticAssetManager implements AssetManagerInterface throw new \RuntimeException( "Failed to create asset stamp file $stamp_file_path. Please check that your web server has the proper access rights to do that."); } - /* } - else { + /* } else { @fclose($fp); } */ @@ -216,13 +216,13 @@ class AsseticAssetManager implements AssetManagerInterface /** * Decode the filters names, and initialize the Assetic FilterManager * - * @param FilterManager $filterManager the Assetic filter manager - * @param string $filters a comma separated list of filter names + * @param FilterManager $filterManager the Assetic filter manager + * @param string $filters a comma separated list of filter names * @throws \InvalidArgumentException if a wrong filter is passed - * @return an array of filter names + * @return an array of filter names */ - protected function decodeAsseticFilters(FilterManager $filterManager, $filters) { - + protected function decodeAsseticFilters(FilterManager $filterManager, $filters) + { if (!empty($filters)) { $filter_list = explode(',', $filters); @@ -261,8 +261,7 @@ class AsseticAssetManager implements AssetManagerInterface break; } } - } - else { + } else { $filter_list = array(); } @@ -272,20 +271,20 @@ class AsseticAssetManager implements AssetManagerInterface /** * Generates assets from $asset_path in $output_path, using $filters. * - * @param $assetSource - * @param $assetDirectoryBase - * @param string $webAssetsDirectoryBase the full path to the asset file (or file collection, e.g. *.less) + * @param $assetSource + * @param $assetDirectoryBase + * @param string $webAssetsDirectoryBase the full path to the asset file (or file collection, e.g. *.less) * - * @param string $webAssetsTemplate the full disk path to the base assets output directory in the web space - * @param $webAssetsKey - * @param string $outputUrl the URL to the base assets output directory in the web space + * @param string $webAssetsTemplate the full disk path to the base assets output directory in the web space + * @param $webAssetsKey + * @param string $outputUrl the URL to the base assets output directory in the web space * - * @param string $assetType the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. - * @param array $filters a list of filters, as defined below (see switch($filter_name) ...) + * @param string $assetType the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. + * @param array $filters a list of filters, as defined below (see switch($filter_name) ...) * - * @param boolean $debug true / false + * @param boolean $debug true / false * - * @return string The URL to the generated asset file. + * @return string The URL to the generated asset file. */ public function processAsset($assetSource, $assetDirectoryBase, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey, $outputUrl, $assetType, $filters, $debug) { diff --git a/core/lib/Thelia/Core/Template/Loop/Cart.php b/core/lib/Thelia/Core/Template/Loop/Cart.php index 32c6d9ff2..aa7d65703 100755 --- a/core/lib/Thelia/Core/Template/Loop/Cart.php +++ b/core/lib/Thelia/Core/Template/Loop/Cart.php @@ -15,7 +15,6 @@ use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; -use Thelia\Model\CountryQuery; use Thelia\TaxEngine\TaxEngine; use Thelia\Type; diff --git a/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php b/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php index ed74a4dac..13335d4c8 100755 --- a/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php @@ -25,8 +25,6 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Condition\ConditionFactory; -use Thelia\Condition\Implementation\ConditionInterface; -use Thelia\Core\HttpFoundation\Request; use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -35,7 +33,6 @@ use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Model\OrderCouponQuery; use Thelia\Model\OrderQuery; -use Thelia\Type; /** * diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 49bab69ec..8ee347f0a 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -36,7 +36,6 @@ use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Exception\TaxEngineException; use Thelia\Model\CategoryQuery; -use Thelia\Model\CountryQuery; use Thelia\Model\CurrencyQuery; use Thelia\Model\Map\ProductPriceTableMap; use Thelia\Model\Map\ProductSaleElementsTableMap; diff --git a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php index 319bb7fee..124f3d162 100755 --- a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php @@ -34,7 +34,6 @@ use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Exception\TaxEngineException; use Thelia\Model\Base\ProductSaleElementsQuery; -use Thelia\Model\CountryQuery; use Thelia\Model\CurrencyQuery; use Thelia\Model\Map\ProductSaleElementsTableMap; use Thelia\TaxEngine\TaxEngine; diff --git a/core/lib/Thelia/Core/Template/Loop/Template.php b/core/lib/Thelia/Core/Template/Loop/Template.php index 9b6ae8a28..e6cf47288 100644 --- a/core/lib/Thelia/Core/Template/Loop/Template.php +++ b/core/lib/Thelia/Core/Template/Loop/Template.php @@ -23,19 +23,12 @@ namespace Thelia\Core\Template\Loop; -use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Security\AccessManager; -use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; -use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; -use Thelia\Model\ModuleQuery; - -use Thelia\Module\BaseModule; use Thelia\Type; use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateDefinition; @@ -72,7 +65,8 @@ class Template extends BaseLoop implements ArraySearchLoopInterface ); } - public function buildArray() { + public function buildArray() + { $type = $this->getArg('template-type')->getValue(); if ($type == 'front-office') diff --git a/core/lib/Thelia/Core/Template/ParserInterface.php b/core/lib/Thelia/Core/Template/ParserInterface.php index 08653f588..22badf688 100755 --- a/core/lib/Thelia/Core/Template/ParserInterface.php +++ b/core/lib/Thelia/Core/Template/ParserInterface.php @@ -43,20 +43,19 @@ interface ParserInterface * * @param unknown $templateType the template type ( * - * @param string $templateName the template name - * @param string $templateDirectory path to the template dirtectory - * @param unknown $key ??? - * @param string $unshift ??? Etienne ? + * @param string $templateName the template name + * @param string $templateDirectory path to the template dirtectory + * @param unknown $key ??? + * @param string $unshift ??? Etienne ? */ public function addTemplateDirectory($templateType, $templateName, $templateDirectory, $key, $unshift = false); - /** * Return the registeted template directories for a givent template type * - * @param unknown $templateType + * @param unknown $templateType * @throws InvalidArgumentException if the tempmateType is not defined - * @return array: an array of defined templates directories for the given template type + * @return array: an array of defined templates directories for the given template type */ public function getTemplateDirectories($templateType); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php index cb867b8c1..18e771336 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php +++ b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Template\Smarty\Assets; -use Thelia\Core\Template\Assets\AsseticHelper; use Thelia\Core\Template\TemplateDefinition; use Thelia\Tools\URL; use Thelia\Core\Template\Assets\AssetManagerInterface; @@ -37,14 +36,14 @@ class SmartyAssetsManager private $web_root; private $path_relative_to_web_root; - static private $assetsDirectory = null; + private static $assetsDirectory = null; /** * Creates a new SmartyAssetsManager instance * - * @param AssetManagerInterface $assetsManager an asset manager instance - * @param string $web_root the disk path to the web root (with final /) - * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated + * @param AssetManagerInterface $assetsManager an asset manager instance + * @param string $web_root the disk path to the web root (with final /) + * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated */ public function __construct(AssetManagerInterface $assetsManager, $web_root, $path_relative_to_web_root) { @@ -67,7 +66,7 @@ class SmartyAssetsManager if (isset($templateDirectories[$templateDefinition->getName()])) { /* create assets foreach registered directory : main @ modules */ - foreach($templateDirectories[$templateDefinition->getName()] as $key => $directory) { + foreach ($templateDirectories[$templateDefinition->getName()] as $key => $directory) { $tpl_path = $directory . DS . self::$assetsDirectory; @@ -95,7 +94,7 @@ class SmartyAssetsManager /* we trick here relative thinking for file attribute */ $file = ltrim($file, '/'); - while(substr($file, 0, 3) == '../') { + while (substr($file, 0, 3) == '../') { $file = substr($file, 3); } diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php index fe6e1cd0a..f652aaa01 100755 --- a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php +++ b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php @@ -14,8 +14,6 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Core\Template\ParserContext; use Thelia\Core\Template\TemplateDefinition; -use Thelia\Model\ConfigQuery; -use Thelia\Core\Template\TemplateHelper; use Imagine\Exception\InvalidArgumentException; use Thelia\Core\Translation\Translator; @@ -72,7 +70,6 @@ class SmartyParser extends Smarty implements ParserInterface $this->setCompileDir($compile_dir); $this->setCacheDir($cache_dir); - $this->debugging = $debug; // Prevent smarty ErrorException: Notice: Undefined index bla bla bla... @@ -80,7 +77,7 @@ class SmartyParser extends Smarty implements ParserInterface // Si on n'est pas en mode debug, activer le cache, avec une lifetime de 15mn, et en vérifiant que les templates sources n'ont pas été modifiés. - if($debug) { + if ($debug) { $this->setCaching(Smarty::CACHING_OFF); $this->setForceCompile(true); } else { @@ -89,7 +86,6 @@ class SmartyParser extends Smarty implements ParserInterface //$this->enableSecurity(); - // The default HTTP status $this->status = 200; @@ -100,15 +96,15 @@ class SmartyParser extends Smarty implements ParserInterface /** * Add a template directory to the current template list * - * @param unknown $templateType the template type (a TemplateDefinition type constant) - * @param string $templateName the template name - * @param string $templateDirectory path to the template dirtectory - * @param unknown $key ??? - * @param string $unshift ??? Etienne ? + * @param unknown $templateType the template type (a TemplateDefinition type constant) + * @param string $templateName the template name + * @param string $templateDirectory path to the template dirtectory + * @param unknown $key ??? + * @param string $unshift ??? Etienne ? */ - public function addTemplateDirectory($templateType, $templateName, $templateDirectory, $key, $unshift = false) { - - if(true === $unshift && isset($this->templateDirectories[$templateType][$templateName])) { + public function addTemplateDirectory($templateType, $templateName, $templateDirectory, $key, $unshift = false) + { + if (true === $unshift && isset($this->templateDirectories[$templateType][$templateName])) { $this->templateDirectories[$templateType][$templateName] = array_merge( array( @@ -124,7 +120,7 @@ class SmartyParser extends Smarty implements ParserInterface /** * Return the registeted template directories for a givent template type * - * @param unknown $templateType + * @param unknown $templateType * @throws InvalidArgumentException * @return multitype: */ @@ -176,7 +172,7 @@ class SmartyParser extends Smarty implements ParserInterface /* do not pass array directly to addTemplateDir since we cant control on keys */ if (isset($this->templateDirectories[$templateDefinition->getType()][$templateDefinition->getName()])) { - foreach($this->templateDirectories[$templateDefinition->getType()][$templateDefinition->getName()] as $key => $directory) { + foreach ($this->templateDirectories[$templateDefinition->getType()][$templateDefinition->getName()] as $key => $directory) { $this->addTemplateDir($directory, $key); } } @@ -194,9 +190,9 @@ class SmartyParser extends Smarty implements ParserInterface /** * Return a rendered template, either from file or ftom a string * - * @param string $resourceType either 'string' (rendering from a string) or 'file' (rendering a file) + * @param string $resourceType either 'string' (rendering from a string) or 'file' (rendering a file) * @param string $resourceContent the resource content (a text, or a template file name) - * @param array $parameters an associative array of names / value pairs + * @param array $parameters an associative array of names / value pairs * * @return string the rendered template text */ @@ -215,8 +211,8 @@ class SmartyParser extends Smarty implements ParserInterface /** * Return a rendered template file * - * @param string $realTemplateName the template name (from the template directory) - * @param array $parameters an associative array of names / value pairs + * @param string $realTemplateName the template name (from the template directory) + * @param array $parameters an associative array of names / value pairs * @return string the rendered template text */ public function render($realTemplateName, array $parameters = array()) @@ -231,8 +227,8 @@ class SmartyParser extends Smarty implements ParserInterface /** * Return a rendered template text * - * @param string $templateText the template text - * @param array $parameters an associative array of names / value pairs + * @param string $templateText the template text + * @param array $parameters an associative array of names / value pairs * @return string the rendered template text */ public function renderString($templateText, array $parameters = array()) @@ -298,4 +294,4 @@ class SmartyParser extends Smarty implements ParserInterface } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/TemplateDefinition.php b/core/lib/Thelia/Core/Template/TemplateDefinition.php index 7a4d1685c..28ac17866 100644 --- a/core/lib/Thelia/Core/Template/TemplateDefinition.php +++ b/core/lib/Thelia/Core/Template/TemplateDefinition.php @@ -57,13 +57,12 @@ class TemplateDefinition */ protected $type; - public function __construct($name, $type) { $this->name = $name; $this->type = $type; - switch($type) { + switch ($type) { case TemplateDefinition::FRONT_OFFICE: $this->path = self::FRONT_OFFICE_SUBDIR . $name; break; @@ -90,14 +89,17 @@ class TemplateDefinition public function setName($name) { $this->name = $name; + return $this; } - public function getI18nPath() { + public function getI18nPath() + { return $this->getPath() . DS . 'I18n'; } - public function getAbsoluteI18nPath() { + public function getAbsoluteI18nPath() + { return THELIA_TEMPLATE_DIR . $this->getI18nPath(); } @@ -106,7 +108,8 @@ class TemplateDefinition return $this->path; } - public function getAbsolutePath() { + public function getAbsolutePath() + { return THELIA_TEMPLATE_DIR . $this->getPath(); } @@ -115,13 +118,15 @@ class TemplateDefinition return $this->getPath() . DS . 'configs'; } - public function getAbsoluteConfigPath() { + public function getAbsoluteConfigPath() + { return THELIA_TEMPLATE_DIR . $this->getConfigPath(); } public function setPath($path) { $this->path = $path; + return $this; } @@ -133,13 +138,15 @@ class TemplateDefinition public function setType($type) { $this->type = $type; + return $this; } /** * Returns an iterator on the standard templates subdir names */ - public static function getStandardTemplatesSubdirsIterator() { + public static function getStandardTemplatesSubdirsIterator() + { return new \ArrayIterator(self::$standardTemplatesSubdirs); } } diff --git a/core/lib/Thelia/Core/Template/TemplateHelper.php b/core/lib/Thelia/Core/Template/TemplateHelper.php index 000a5bfd5..a95d7b899 100644 --- a/core/lib/Thelia/Core/Template/TemplateHelper.php +++ b/core/lib/Thelia/Core/Template/TemplateHelper.php @@ -93,7 +93,8 @@ class TemplateHelper /** * Returns an array which contains all standard template definitions */ - public function getStandardTemplateDefinitions() { + public function getStandardTemplateDefinitions() + { return array( $this->getActiveFrontTemplate(), $this->getActiveAdminTemplate(), @@ -105,16 +106,16 @@ class TemplateHelper /** * Return a list of existing templates for a given template type * - * @param int $templateType the template type - * @return An array of \Thelia\Core\Template\TemplateDefinition + * @param int $templateType the template type + * @return An array of \Thelia\Core\Template\TemplateDefinition */ - public function getList($templateType) { - + public function getList($templateType) + { $list = $exclude = array(); $tplIterator = TemplateDefinition::getStandardTemplatesSubdirsIterator(); - foreach($tplIterator as $type => $subdir) { + foreach ($tplIterator as $type => $subdir) { if ($templateType == $type) { diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php index 7a1d96750..844eb3d29 100755 --- a/core/lib/Thelia/Core/Thelia.php +++ b/core/lib/Thelia/Core/Thelia.php @@ -49,7 +49,6 @@ use Thelia\Config\DefinePropel; use Thelia\Core\Template\TemplateDefinition; use Thelia\Core\TheliaContainerBuilder; use Thelia\Core\DependencyInjection\Loader\XmlFileLoader; -use Thelia\Model\ConfigQuery; use Symfony\Component\Config\FileLocator; use Propel\Runtime\Propel; @@ -110,12 +109,13 @@ class Thelia extends Kernel * Add all module's standard templates to the parser environment * * @param TheliaParser $parser the parser - * @param Module $module the Module. + * @param Module $module the Module. */ - protected function addStandardModuleTemplatesToParserEnvironment($parser, $module) { + protected function addStandardModuleTemplatesToParserEnvironment($parser, $module) + { $stdTpls = TemplateDefinition::getStandardTemplatesSubdirsIterator(); - foreach($stdTpls as $templateType => $templateSubdirName) { + foreach ($stdTpls as $templateType => $templateSubdirName) { $this->addModuleTemplateToParserEnvironment($parser, $module, $templateType, $templateSubdirName); } } @@ -123,13 +123,13 @@ class Thelia extends Kernel /** * Add a module template directory to the parser environment * - * @param TheliaParser $parser the parser - * @param Module $module the Module. - * @param string $templateType the template type (one of the TemplateDefinition type constants) - * @param string $templateSubdirName the template subdirectory name (one of the TemplateDefinition::XXX_SUBDIR constants) + * @param TheliaParser $parser the parser + * @param Module $module the Module. + * @param string $templateType the template type (one of the TemplateDefinition type constants) + * @param string $templateSubdirName the template subdirectory name (one of the TemplateDefinition::XXX_SUBDIR constants) */ - protected function addModuleTemplateToParserEnvironment($parser, $module, $templateType, $templateSubdirName) { - + protected function addModuleTemplateToParserEnvironment($parser, $module, $templateType, $templateSubdirName) + { // Get template path $templateDirectory = $module->getAbsoluteTemplateDirectoryPath($templateSubdirName); @@ -155,8 +155,7 @@ class Thelia extends Kernel ); } } - } - catch (\UnexpectedValueException $ex) { + } catch (\UnexpectedValueException $ex) { // The directory does not exists, ignore it. } } @@ -176,7 +175,7 @@ class Thelia extends Kernel ->depth(0) ->in(THELIA_ROOT . "/core/lib/Thelia/Config/Resources"); - foreach($finder as $file) { + foreach ($finder as $file) { $loader->load($file->getBaseName()); } @@ -219,7 +218,7 @@ class Thelia extends Kernel // Standard templates (front, back, pdf, mail) $th = TemplateHelper::getInstance(); - foreach($th->getStandardTemplateDefinitions() as $templateDefinition) { + foreach ($th->getStandardTemplateDefinitions() as $templateDefinition) { if (is_dir($dir = $templateDefinition->getAbsoluteI18nPath())) { $translationDirs[] = $dir; } @@ -370,4 +369,4 @@ class Thelia extends Kernel //Nothing is load here but it's possible to load container configuration here. //exemple in sf2 : $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Coupon/BaseFacade.php b/core/lib/Thelia/Coupon/BaseFacade.php index 3df562333..d1f1d22a6 100644 --- a/core/lib/Thelia/Coupon/BaseFacade.php +++ b/core/lib/Thelia/Coupon/BaseFacade.php @@ -57,9 +57,9 @@ class BaseFacade implements FacadeInterface /** * Constructor * - * @param ContainerInterface $container Service container + * @param ContainerInterface $container Service container */ - function __construct(ContainerInterface $container) + public function __construct(ContainerInterface $container) { $this->container = $container; } @@ -135,7 +135,6 @@ class BaseFacade implements FacadeInterface return $this->getRequest()->getSession()->getCurrency()->getCode(); } - /** * Return the number of Products in the Cart * @@ -202,7 +201,6 @@ class BaseFacade implements FacadeInterface return $this->container->get('thelia.translator'); } - /** * Return the main currency * THe one used to set prices in BackOffice @@ -234,7 +232,6 @@ class BaseFacade implements FacadeInterface return $this->container->get('thelia.condition.validator'); } - /** * Return all available currencies * diff --git a/core/lib/Thelia/Coupon/CouponFactory.php b/core/lib/Thelia/Coupon/CouponFactory.php index e34ee9263..69eb75162 100644 --- a/core/lib/Thelia/Coupon/CouponFactory.php +++ b/core/lib/Thelia/Coupon/CouponFactory.php @@ -63,7 +63,7 @@ class CouponFactory * * @throws \Thelia\Exception\CouponExpiredException * @throws \Thelia\Exception\InvalidConditionException - * @return CouponInterface ready to be processed + * @return CouponInterface ready to be processed */ public function buildCouponFromCode($couponCode) { @@ -132,6 +132,4 @@ class CouponFactory return clone $couponManager; } - - } diff --git a/core/lib/Thelia/Coupon/CouponManager.php b/core/lib/Thelia/Coupon/CouponManager.php index 83cfffb52..92fc8e572 100644 --- a/core/lib/Thelia/Coupon/CouponManager.php +++ b/core/lib/Thelia/Coupon/CouponManager.php @@ -60,7 +60,6 @@ class CouponManager $this->facade = $container->get('thelia.facade'); } - /** * Get Discount for the given Coupons * @@ -241,10 +240,10 @@ class CouponManager $ret = $usageLeft; } - } catch(\Exception $e) { + } catch (\Exception $e) { $ret = false; } return $ret; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Coupon/FacadeInterface.php b/core/lib/Thelia/Coupon/FacadeInterface.php index 2b78a49d6..9e93115d0 100644 --- a/core/lib/Thelia/Coupon/FacadeInterface.php +++ b/core/lib/Thelia/Coupon/FacadeInterface.php @@ -43,9 +43,9 @@ interface FacadeInterface /** * Constructor * - * @param ContainerInterface $container Service container + * @param ContainerInterface $container Service container */ - function __construct(ContainerInterface $container); + public function __construct(ContainerInterface $container); /** * Return a Cart a CouponManager can process @@ -170,4 +170,4 @@ interface FacadeInterface */ public function getDispatcher(); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Coupon/Type/CouponAbstract.php b/core/lib/Thelia/Coupon/Type/CouponAbstract.php index 5e83afb85..ac4893478 100644 --- a/core/lib/Thelia/Coupon/Type/CouponAbstract.php +++ b/core/lib/Thelia/Coupon/Type/CouponAbstract.php @@ -23,7 +23,6 @@ namespace Thelia\Coupon\Type; -use Symfony\Component\Intl\Exception\NotImplementedException; use Thelia\Condition\ConditionEvaluator; use Thelia\Core\Translation\Translator; use Thelia\Coupon\FacadeInterface; @@ -62,7 +61,6 @@ abstract class CouponAbstract implements CouponInterface /** @var ConditionEvaluator Condition validator */ protected $conditionEvaluator = null; - /** @var string Service Id */ protected $serviceId = null; @@ -75,8 +73,6 @@ abstract class CouponAbstract implements CouponInterface /** @var string Coupon code (ex: XMAS) */ protected $code = null; - - /** @var string Coupon title (ex: Coupon for XMAS) */ protected $title = null; @@ -86,8 +82,6 @@ abstract class CouponAbstract implements CouponInterface /** @var string Coupon description */ protected $description = null; - - /** @var bool if Coupon is enabled */ protected $isEnabled = false; @@ -106,7 +100,6 @@ abstract class CouponAbstract implements CouponInterface /** @var bool if Coupon is available for Products already on special offers */ protected $isAvailableOnSpecialOffers = false; - /** * Constructor * @@ -146,9 +139,9 @@ abstract class CouponAbstract implements CouponInterface * @param bool $isRemovingPostage If Coupon is removing postage * @param bool $isAvailableOnSpecialOffers If available on Product already * on special offer price - * @param bool $isEnabled False if Coupon is disabled by admin - * @param int $maxUsage How many usage left - * @param \Datetime $expirationDate When the Code is expiring + * @param bool $isEnabled False if Coupon is disabled by admin + * @param int $maxUsage How many usage left + * @param \Datetime $expirationDate When the Code is expiring * * @return $this */ @@ -355,7 +348,6 @@ abstract class CouponAbstract implements CouponInterface return $this->serviceId; } - /** * Check if the current state of the application is matching this Coupon conditions * Thelia variables are given by the FacadeInterface @@ -398,5 +390,4 @@ abstract class CouponAbstract implements CouponInterface return $this->extendedInputs; } - } diff --git a/core/lib/Thelia/Coupon/Type/CouponInterface.php b/core/lib/Thelia/Coupon/Type/CouponInterface.php index a45d6cbab..7f58d282c 100644 --- a/core/lib/Thelia/Coupon/Type/CouponInterface.php +++ b/core/lib/Thelia/Coupon/Type/CouponInterface.php @@ -76,9 +76,9 @@ interface CouponInterface * @param bool $isRemovingPostage If Coupon is removing postage * @param bool $isAvailableOnSpecialOffers If available on Product already * on special offer price - * @param bool $isEnabled False if Coupon is disabled by admin - * @param int $maxUsage How many usage left - * @param \Datetime $expirationDate When the Code is expiring + * @param bool $isEnabled False if Coupon is disabled by admin + * @param int $maxUsage How many usage left + * @param \Datetime $expirationDate When the Code is expiring */ public function set( FacadeInterface $facade, @@ -138,8 +138,6 @@ interface CouponInterface */ public function isRemovingPostage(); - - /** * Return condition to validate the Coupon or not * @@ -173,7 +171,6 @@ interface CouponInterface */ public function isAvailableOnSpecialOffers(); - /** * Check if Coupon has been disabled by admin * @@ -196,7 +193,6 @@ interface CouponInterface */ public function isExpired(); - /** * Return effects generated by the coupon * A positive value diff --git a/core/lib/Thelia/Coupon/Type/RemoveXPercent.php b/core/lib/Thelia/Coupon/Type/RemoveXPercent.php index 7d83de333..b6c13df1a 100644 --- a/core/lib/Thelia/Coupon/Type/RemoveXPercent.php +++ b/core/lib/Thelia/Coupon/Type/RemoveXPercent.php @@ -60,9 +60,9 @@ class RemoveXPercent extends CouponAbstract * @param bool $isRemovingPostage If Coupon is removing postage * @param bool $isAvailableOnSpecialOffers If available on Product already * on special offer price - * @param bool $isEnabled False if Coupon is disabled by admin - * @param int $maxUsage How many usage left - * @param \Datetime $expirationDate When the Code is expiring + * @param bool $isEnabled False if Coupon is disabled by admin + * @param int $maxUsage How many usage left + * @param \Datetime $expirationDate When the Code is expiring * * @return $this */ @@ -110,7 +110,6 @@ class RemoveXPercent extends CouponAbstract return $basePrice * (( $this->percentage ) / 100); } - /** * Get I18n name * @@ -174,4 +173,4 @@ class RemoveXPercent extends CouponAbstract return $html; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Form/MailingSystemModificationForm.php b/core/lib/Thelia/Form/MailingSystemModificationForm.php index 709c19144..144037a50 100644 --- a/core/lib/Thelia/Form/MailingSystemModificationForm.php +++ b/core/lib/Thelia/Form/MailingSystemModificationForm.php @@ -22,7 +22,6 @@ /*************************************************************************************/ namespace Thelia\Form; -use Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\ExecutionContextInterface; use Thelia\Core\Translation\Translator; use Thelia\Model\ProfileQuery; diff --git a/core/lib/Thelia/Install/BaseInstall.php b/core/lib/Thelia/Install/BaseInstall.php index aa41140dd..2e602b1b6 100644 --- a/core/lib/Thelia/Install/BaseInstall.php +++ b/core/lib/Thelia/Install/BaseInstall.php @@ -53,9 +53,8 @@ abstract class BaseInstall throw new AlreadyInstallException("Thelia is already installed"); } - $this->exec(); } abstract public function exec(); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Install/CheckDatabaseConnection.php b/core/lib/Thelia/Install/CheckDatabaseConnection.php index c9c2060f5..4a6d4a33b 100644 --- a/core/lib/Thelia/Install/CheckDatabaseConnection.php +++ b/core/lib/Thelia/Install/CheckDatabaseConnection.php @@ -24,12 +24,8 @@ namespace Thelia\Install; use PDO; -use RecursiveDirectoryIterator; -use RecursiveIteratorIterator; use Symfony\Component\Translation\TranslatorInterface; use Thelia\Core\Translation\Translator; -use Thelia\Install\Exception\InstallException; - /** * Class CheckDatabaseConnection diff --git a/core/lib/Thelia/Install/CheckPermission.php b/core/lib/Thelia/Install/CheckPermission.php index efdaf6f04..38b6049dc 100644 --- a/core/lib/Thelia/Install/CheckPermission.php +++ b/core/lib/Thelia/Install/CheckPermission.php @@ -28,7 +28,6 @@ use RecursiveIteratorIterator; use Symfony\Component\Translation\TranslatorInterface; use Thelia\Core\Translation\Translator; - /** * Class CheckPermission * @@ -164,9 +163,6 @@ class CheckPermission extends BaseInstall } } - - - return $this->isValid; } @@ -200,7 +196,6 @@ class CheckPermission extends BaseInstall return (is_writable(THELIA_ROOT . $directory) === true); } - /** * Get Translated text about the directory state * @@ -269,7 +264,6 @@ class CheckPermission extends BaseInstall return $translatedText; } - /** * Get Translated text about the directory state * Not usable with CLI @@ -382,7 +376,7 @@ class CheckPermission extends BaseInstall { $serverValueInBytes = $this->returnBytes(ini_get($key)); - if($serverValueInBytes == -1) { + if ($serverValueInBytes == -1) { return true; } @@ -400,7 +394,7 @@ class CheckPermission extends BaseInstall { $val = trim($val); $last = strtolower($val[strlen($val)-1]); - switch($last) { + switch ($last) { // The 'G' modifier is available since PHP 5.1.0 case 'g': $val *= 1024; diff --git a/core/lib/Thelia/Install/Database.php b/core/lib/Thelia/Install/Database.php index d17bd7c3d..4fad6d4a2 100644 --- a/core/lib/Thelia/Install/Database.php +++ b/core/lib/Thelia/Install/Database.php @@ -23,7 +23,6 @@ namespace Thelia\Install; - /** * Class Database * @package Thelia\Install @@ -112,4 +111,4 @@ class Database ) ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Install/Exception/AlreadyInstallException.php b/core/lib/Thelia/Install/Exception/AlreadyInstallException.php index 1409c7cdd..b2ff1555e 100644 --- a/core/lib/Thelia/Install/Exception/AlreadyInstallException.php +++ b/core/lib/Thelia/Install/Exception/AlreadyInstallException.php @@ -23,7 +23,6 @@ namespace Thelia\Install\Exception; - /** * Class AlreadyInstallException * @package Thelia\Install\Exception @@ -32,4 +31,4 @@ namespace Thelia\Install\Exception; class AlreadyInstallException extends InstallException { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Install/Exception/InstallException.php b/core/lib/Thelia/Install/Exception/InstallException.php index 6924bcfe5..2d0f45fe4 100644 --- a/core/lib/Thelia/Install/Exception/InstallException.php +++ b/core/lib/Thelia/Install/Exception/InstallException.php @@ -29,4 +29,4 @@ namespace Thelia\Install\Exception; class InstallException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Install/Exception/UpToDateException.php b/core/lib/Thelia/Install/Exception/UpToDateException.php index 45db7eb5a..e7401fe88 100644 --- a/core/lib/Thelia/Install/Exception/UpToDateException.php +++ b/core/lib/Thelia/Install/Exception/UpToDateException.php @@ -23,7 +23,6 @@ namespace Thelia\Install\Exception; - /** * Class UpToDateException * @package Thelia\Install\Exception @@ -32,4 +31,4 @@ namespace Thelia\Install\Exception; class UpToDateException extends InstallException { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Install/Update.php b/core/lib/Thelia/Install/Update.php index 0a1011aec..923c8f1ab 100644 --- a/core/lib/Thelia/Install/Update.php +++ b/core/lib/Thelia/Install/Update.php @@ -29,13 +29,12 @@ use Thelia\Log\Tlog; use Thelia\Model\ConfigQuery; use Thelia\Model\Map\ProductTableMap; - /** * Class Update * @package Thelia\Install * @author Manuel Raynaud */ -class Update +class Update { protected static $version = array( '0' => '2.0.0-beta1', @@ -61,7 +60,7 @@ class Update $currentVersion = ConfigQuery::read('thelia_version'); $logger->debug("start update process"); - if(true === $this->isLatestVersion($currentVersion)) { + if (true === $this->isLatestVersion($currentVersion)) { $logger->debug("You already have the latest version. No update available"); throw new UpToDateException('You already have the latest version. No update available'); } @@ -78,7 +77,7 @@ class Update } $con->commit(); $logger->debug('update successfully'); - } catch(PropelException $e) { + } catch (PropelException $e) { $con->rollBack(); $logger->error(sprintf('error during update process with message : %s', $e->getMessage())); throw $e; @@ -99,4 +98,4 @@ class Update ConfigQuery::write('thelia_version', $version); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Mailer/MailerFactory.php b/core/lib/Thelia/Mailer/MailerFactory.php index e4fee490e..00cb2cb32 100644 --- a/core/lib/Thelia/Mailer/MailerFactory.php +++ b/core/lib/Thelia/Mailer/MailerFactory.php @@ -27,13 +27,13 @@ use Thelia\Core\Event\MailTransporterEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Model\ConfigQuery; - /** * Class MailerFactory * @package Thelia\Mailer * @author Manuel Raynaud */ -class MailerFactory { +class MailerFactory +{ /** * @var \Swift_Mailer */ @@ -49,7 +49,7 @@ class MailerFactory { $transporterEvent = new MailTransporterEvent(); $this->dispatcher->dispatch(TheliaEvents::MAILTRANSPORTER_CONFIG, $transporterEvent); - if($transporterEvent->hasTransporter()) { + if ($transporterEvent->hasTransporter()) { $transporter = $transporterEvent->getTransporter(); } else { if (ConfigQuery::isSmtpEnable()) { @@ -74,6 +74,7 @@ class MailerFactory { ->setTimeout(ConfigQuery::getSmtpTimeout()) ->setSourceIp(ConfigQuery::getSmtpSourceIp()) ; + return $smtpTransporter; } @@ -87,5 +88,4 @@ class MailerFactory { return $this->swiftMailer; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Rewriting/RewritingResolver.php b/core/lib/Thelia/Rewriting/RewritingResolver.php index 8edd0ebba..91be66b55 100755 --- a/core/lib/Thelia/Rewriting/RewritingResolver.php +++ b/core/lib/Thelia/Rewriting/RewritingResolver.php @@ -22,12 +22,8 @@ /*************************************************************************************/ namespace Thelia\Rewriting; -use Propel\Runtime\ActiveQuery\Criteria; -use Propel\Runtime\ActiveQuery\Join; -use Thelia\Exception\RewritingUrlException; use Thelia\Exception\UrlRewritingException; use Thelia\Model\RewritingUrlQuery; -use Thelia\Model\Map\RewritingUrlTableMap; /** * Class RewritingResolver @@ -51,7 +47,7 @@ class RewritingResolver { $this->rewritingUrlQuery = new RewritingUrlQuery(); - if($url !== null) { + if ($url !== null) { $this->load($url); } } @@ -62,7 +58,7 @@ class RewritingResolver $rewrittenUrl = urldecode($rewrittenUrl); $this->search = $this->rewritingUrlQuery->getResolverSearch($rewrittenUrl); - if($this->search->count() == 0) { + if ($this->search->count() == 0) { throw new UrlRewritingException('URL NOT FOUND', UrlRewritingException::URL_NOT_FOUND); } @@ -76,16 +72,16 @@ class RewritingResolver protected function getOtherParameters() { - if($this->search === null) { + if ($this->search === null) { throw new UrlRewritingException('RESOLVER NULL SEARCH', UrlRewritingException::RESOLVER_NULL_SEARCH); } $otherParameters = array(); - foreach($this->search as $result) { + foreach ($this->search as $result) { $parameter = $result->getParameter(); $value = $result->getValue(); - if(null !== $parameter) { + if (null !== $parameter) { $otherParameters[$parameter] = $value; } } @@ -93,5 +89,4 @@ class RewritingResolver return $otherParameters; } - } diff --git a/core/lib/Thelia/Rewriting/RewritingRetriever.php b/core/lib/Thelia/Rewriting/RewritingRetriever.php index ce6ada8e7..cfff07914 100755 --- a/core/lib/Thelia/Rewriting/RewritingRetriever.php +++ b/core/lib/Thelia/Rewriting/RewritingRetriever.php @@ -22,9 +22,7 @@ /*************************************************************************************/ namespace Thelia\Rewriting; -use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Model\RewritingUrlQuery; -use Thelia\Model\Map\RewritingUrlTableMap; use Thelia\Tools\URL; /** @@ -46,7 +44,7 @@ class RewritingRetriever { $this->rewritingUrlQuery = new RewritingUrlQuery(); - if($view !== null && $viewLocale !== null) { + if ($view !== null && $viewLocale !== null) { $this->load($view, $viewLocale, $viewId); } } @@ -61,16 +59,16 @@ class RewritingRetriever $this->search = $this->rewritingUrlQuery->getViewUrlQuery($view, $viewLocale, $viewId); $allParametersWithoutView = array(); - if(null !== $viewId) { + if (null !== $viewId) { $allParametersWithoutView['locale'] = $viewLocale; } - if(null !== $viewId) { + if (null !== $viewId) { $allParametersWithoutView[$view . '_id'] = $viewId; } $this->rewrittenUrl = null; $this->url = URL::getInstance()->viewUrl($view, $allParametersWithoutView); - if($this->search !== null) { + if ($this->search !== null) { $this->rewrittenUrl = URL::getInstance()->absoluteUrl( $this->search->getUrl() ); @@ -85,8 +83,9 @@ class RewritingRetriever */ public function loadSpecificUrl($view, $viewLocale, $viewId = null, $viewOtherParameters = array()) { - if(empty($viewOtherParameters)) { + if (empty($viewOtherParameters)) { $this->loadViewUrl($view, $viewLocale, $viewId); + return; } @@ -94,13 +93,13 @@ class RewritingRetriever $allParametersWithoutView = $viewOtherParameters; $allParametersWithoutView['locale'] = $viewLocale; - if(null !== $viewId) { + if (null !== $viewId) { $allParametersWithoutView[$view . '_id'] = $viewId; } $this->rewrittenUrl = null; $this->url = URL::getInstance()->viewUrl($view, $allParametersWithoutView); - if($this->search !== null) { + if ($this->search !== null) { $this->rewrittenUrl = $this->search->getUrl(); } } diff --git a/core/lib/Thelia/TaxEngine/Calculator.php b/core/lib/Thelia/TaxEngine/Calculator.php index a067f200d..c0f01ea1e 100755 --- a/core/lib/Thelia/TaxEngine/Calculator.php +++ b/core/lib/Thelia/TaxEngine/Calculator.php @@ -61,10 +61,10 @@ class Calculator $this->country = null; $this->taxRulesCollection = null; - if($product->getId() === null) { + if ($product->getId() === null) { throw new TaxEngineException('Product id is empty in Calculator::load', TaxEngineException::UNDEFINED_PRODUCT); } - if($country->getId() === null) { + if ($country->getId() === null) { throw new TaxEngineException('Country id is empty in Calculator::load', TaxEngineException::UNDEFINED_COUNTRY); } @@ -82,13 +82,13 @@ class Calculator $this->country = null; $this->taxRulesCollection = null; - if($taxRule->getId() === null) { + if ($taxRule->getId() === null) { throw new TaxEngineException('TaxRule id is empty in Calculator::loadTaxRule', TaxEngineException::UNDEFINED_TAX_RULE); } - if($country->getId() === null) { + if ($country->getId() === null) { throw new TaxEngineException('Country id is empty in Calculator::loadTaxRule', TaxEngineException::UNDEFINED_COUNTRY); } - if($product->getId() === null) { + if ($product->getId() === null) { throw new TaxEngineException('Product id is empty in Calculator::load', TaxEngineException::UNDEFINED_PRODUCT); } @@ -120,15 +120,15 @@ class Calculator */ public function getTaxedPrice($untaxedPrice, &$taxCollection = null, $askedLocale = null) { - if(null === $this->taxRulesCollection) { + if (null === $this->taxRulesCollection) { throw new TaxEngineException('Tax rules collection is empty in Calculator::getTaxedPrice', TaxEngineException::UNDEFINED_TAX_RULES_COLLECTION); } - if(null === $this->product) { + if (null === $this->product) { throw new TaxEngineException('Product is empty in Calculator::getTaxedPrice', TaxEngineException::UNDEFINED_PRODUCT); } - if(false === filter_var($untaxedPrice, FILTER_VALIDATE_FLOAT)) { + if (false === filter_var($untaxedPrice, FILTER_VALIDATE_FLOAT)) { throw new TaxEngineException('BAD AMOUNT FORMAT', TaxEngineException::BAD_AMOUNT_FORMAT); } @@ -136,16 +136,16 @@ class Calculator $currentPosition = 1; $currentTax = 0; - if(null !== $taxCollection) { + if (null !== $taxCollection) { $taxCollection = new OrderProductTaxCollection(); } - foreach($this->taxRulesCollection as $taxRule) { - $position = (int)$taxRule->getTaxRuleCountryPosition(); + foreach ($this->taxRulesCollection as $taxRule) { + $position = (int) $taxRule->getTaxRuleCountryPosition(); $taxType = $taxRule->getTypeInstance(); $taxType->loadRequirements( $taxRule->getRequirements() ); - if($currentPosition !== $position) { + if ($currentPosition !== $position) { $taxedPrice += $currentTax; $currentTax = 0; $currentPosition = $position; @@ -154,7 +154,7 @@ class Calculator $taxAmount = round($taxType->calculate($this->product, $taxedPrice), 2); $currentTax += $taxAmount; - if(null !== $taxCollection) { + if (null !== $taxCollection) { $taxI18n = I18n::forceI18nRetrieving($askedLocale, 'Tax', $taxRule->getId()); $orderProductTax = new OrderProductTax(); $orderProductTax->setTitle($taxI18n->getTitle()); @@ -171,36 +171,36 @@ class Calculator public function getUntaxedPrice($taxedPrice) { - if(null === $this->taxRulesCollection) { + if (null === $this->taxRulesCollection) { throw new TaxEngineException('Tax rules collection is empty in Calculator::getTaxAmount', TaxEngineException::UNDEFINED_TAX_RULES_COLLECTION); } - if(null === $this->product) { + if (null === $this->product) { throw new TaxEngineException('Product is empty in Calculator::getTaxedPrice', TaxEngineException::UNDEFINED_PRODUCT); } - if(false === filter_var($taxedPrice, FILTER_VALIDATE_FLOAT)) { + if (false === filter_var($taxedPrice, FILTER_VALIDATE_FLOAT)) { throw new TaxEngineException('BAD AMOUNT FORMAT', TaxEngineException::BAD_AMOUNT_FORMAT); } $taxRule = $this->taxRulesCollection->getLast(); - if(null === $taxRule) { + if (null === $taxRule) { throw new TaxEngineException('Tax rules collection got no tax ', TaxEngineException::NO_TAX_IN_TAX_RULES_COLLECTION); } $untaxedPrice = $taxedPrice; - $currentPosition = (int)$taxRule->getTaxRuleCountryPosition(); + $currentPosition = (int) $taxRule->getTaxRuleCountryPosition(); $currentFixTax = 0; $currentTaxFactor = 0; do { - $position = (int)$taxRule->getTaxRuleCountryPosition(); + $position = (int) $taxRule->getTaxRuleCountryPosition(); $taxType = $taxRule->getTypeInstance(); $taxType->loadRequirements( $taxRule->getRequirements() ); - if($currentPosition !== $position) { + if ($currentPosition !== $position) { $untaxedPrice -= $currentFixTax; $untaxedPrice = $untaxedPrice / (1+$currentTaxFactor); $currentFixTax = 0; @@ -211,8 +211,7 @@ class Calculator $currentFixTax += $taxType->fixAmountRetriever($this->product); $currentTaxFactor += $taxType->pricePercentRetriever(); - - } while($taxRule = $this->taxRulesCollection->getPrevious()); + } while ($taxRule = $this->taxRulesCollection->getPrevious()); $untaxedPrice -= $currentFixTax; $untaxedPrice = $untaxedPrice / (1+$currentTaxFactor); @@ -224,7 +223,7 @@ class Calculator $untaxedPrice -= $taxType->fixAmountRetriever(); - } while($taxRule = $this->taxRulesCollection->getPrevious()); + } while ($taxRule = $this->taxRulesCollection->getPrevious()); $taxRule = $this->taxRulesCollection->getLast(); @@ -238,7 +237,7 @@ class Calculator $toto = true; - } while($taxRule = $this->taxRulesCollection->getPrevious()); + } while ($taxRule = $this->taxRulesCollection->getPrevious()); $untaxedPrice = $untaxedPrice / (1+$currentTaxFactor);*/ diff --git a/core/lib/Thelia/TaxEngine/TaxEngine.php b/core/lib/Thelia/TaxEngine/TaxEngine.php index 36406dc59..f14db2205 100755 --- a/core/lib/Thelia/TaxEngine/TaxEngine.php +++ b/core/lib/Thelia/TaxEngine/TaxEngine.php @@ -42,13 +42,13 @@ class TaxEngine */ protected $session = null; - static public function getInstance(Session $session = null) + public static function getInstance(Session $session = null) { - if(null === self::$instance) { + if (null === self::$instance) { self::$instance = new TaxEngine(); } - if(null !== self::$instance) { + if (null !== self::$instance) { self::$instance->setSession($session); } @@ -85,7 +85,7 @@ class TaxEngine $fileName = $directoryContent->getFilename(); $className = substr($fileName, 0, (1+strlen($directoryContent->getExtension())) * -1); - if($className == "BaseTaxType") { + if ($className == "BaseTaxType") { continue; } @@ -101,14 +101,14 @@ class TaxEngine * Then look at the current customer default address country * Else look at the default website country * - * @param bool $force result is static cached ; even if a below parameter change between 2 calls, we need to keep coherent results. but you can force it. + * @param bool $force result is static cached ; even if a below parameter change between 2 calls, we need to keep coherent results. but you can force it. * @return null|TaxEngine */ public function getDeliveryCountry($force = false) { - if(false === $force || null === self::$taxCountry) { + if (false === $force || null === self::$taxCountry) { /* is there a logged in customer ? */ - if(null !== $customer = $this->session->getCustomerUser()) { + if (null !== $customer = $this->session->getCustomerUser()) { if (null !== $this->session->getOrder() && null !== $this->session->getOrder()->chosenDeliveryAddress && null !== $currentDeliveryAddress = AddressQuery::create()->findPk($this->session->getOrder()->chosenDeliveryAddress)) { diff --git a/core/lib/Thelia/TaxEngine/TaxType/BaseTaxType.php b/core/lib/Thelia/TaxEngine/TaxType/BaseTaxType.php index f8bdd8647..e5dd69a06 100755 --- a/core/lib/Thelia/TaxEngine/TaxType/BaseTaxType.php +++ b/core/lib/Thelia/TaxEngine/TaxType/BaseTaxType.php @@ -35,13 +35,13 @@ abstract class BaseTaxType { protected $requirements = null; - public abstract function pricePercentRetriever(); + abstract public function pricePercentRetriever(); - public abstract function fixAmountRetriever(Product $product); + abstract public function fixAmountRetriever(Product $product); - public abstract function getRequirementsList(); + abstract public function getRequirementsList(); - public abstract function getTitle(); + abstract public function getTitle(); public function calculate(Product $product, $untaxedPrice) { @@ -52,20 +52,20 @@ abstract class BaseTaxType { $this->requirements = $this->getRequirementsList(); - if(!is_array($this->requirements)) { + if (!is_array($this->requirements)) { throw new TaxEngineException('getRequirementsList must return an array', TaxEngineException::TAX_TYPE_BAD_ABSTRACT_METHOD); } - foreach($this->requirements as $requirement => $requirementType) { - if(!$requirementType instanceof TypeInterface) { + foreach ($this->requirements as $requirement => $requirementType) { + if (!$requirementType instanceof TypeInterface) { throw new TaxEngineException('getRequirementsList must return an array of TypeInterface', TaxEngineException::TAX_TYPE_BAD_ABSTRACT_METHOD); } - if(!array_key_exists($requirement, $requirementsValues)) { + if (!array_key_exists($requirement, $requirementsValues)) { throw new TaxEngineException('Cannot load requirements : requirement value for `' . $requirement . '` not found', TaxEngineException::TAX_TYPE_REQUIREMENT_NOT_FOUND); } - if(!$requirementType->isValid($requirementsValues[$requirement])) { + if (!$requirementType->isValid($requirementsValues[$requirement])) { throw new TaxEngineException('Requirement value for `' . $requirement . '` does not match required type', TaxEngineException::TAX_TYPE_BAD_REQUIREMENT_VALUE); } @@ -75,11 +75,11 @@ abstract class BaseTaxType public function getRequirement($key) { - if($this->requirements === null) { + if ($this->requirements === null) { throw new TaxEngineException('Requirements are empty in BaseTaxType::getRequirement', TaxEngineException::UNDEFINED_REQUIREMENTS); } - if(!array_key_exists($key, $this->requirements)) { + if (!array_key_exists($key, $this->requirements)) { throw new TaxEngineException('Requirement value for `' . $key . '` does not exists in BaseTaxType::$requirements', TaxEngineException::UNDEFINED_REQUIREMENT_VALUE); } diff --git a/core/lib/Thelia/TaxEngine/TaxType/FeatureFixAmountTaxType.php b/core/lib/Thelia/TaxEngine/TaxType/FeatureFixAmountTaxType.php index e623528c2..baae41055 100755 --- a/core/lib/Thelia/TaxEngine/TaxType/FeatureFixAmountTaxType.php +++ b/core/lib/Thelia/TaxEngine/TaxType/FeatureFixAmountTaxType.php @@ -52,7 +52,7 @@ class FeatureFixAmountTaxType extends BaseTaxType $taxAmount = $query->getFreeTextValue(); $testInt = new FloatType(); - if(!$testInt->isValid($taxAmount)) { + if (!$testInt->isValid($taxAmount)) { throw new TaxEngineException('Feature value does not match FLOAT format', TaxEngineException::FEATURE_BAD_EXPECTED_VALUE); } diff --git a/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php b/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php index f4de7ee02..74d139c4e 100644 --- a/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php +++ b/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php @@ -406,7 +406,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponManager = new RemoveXAmount($stubFacade); - $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::SUPERIOR, @@ -439,7 +438,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('unserializeConditionCollection') ->will($this->returnValue($conditions)); - $stubContainer->expects($this->any()) ->method('get') ->will($this->onConsecutiveCalls($stubFacade, $couponManager, $stubConditionFactory));