Applied php-cs-fixer

This commit is contained in:
Franck Allimant
2014-05-17 10:24:22 +02:00
parent f8ccea1899
commit ef142ca077
23 changed files with 76 additions and 88 deletions

View File

@@ -28,8 +28,6 @@ use Thelia\Coupon\Type\CouponInterface;
use Thelia\Model\Coupon as CouponModel; use Thelia\Model\Coupon as CouponModel;
use Thelia\Model\CouponCountry; use Thelia\Model\CouponCountry;
use Thelia\Model\CouponCountryQuery; use Thelia\Model\CouponCountryQuery;
use Thelia\Model\CouponCustomerCount;
use Thelia\Model\CouponCustomerCountQuery;
use Thelia\Model\CouponModule; use Thelia\Model\CouponModule;
use Thelia\Model\CouponModuleQuery; use Thelia\Model\CouponModuleQuery;
use Thelia\Model\CouponQuery; use Thelia\Model\CouponQuery;
@@ -309,7 +307,7 @@ class Coupon extends BaseAction implements EventSubscriberInterface
$couponCountries = CouponCountryQuery::create()->filterByCouponId($couponModel->getId())->find(); $couponCountries = CouponCountryQuery::create()->filterByCouponId($couponModel->getId())->find();
/** @var CouponCountry $couponCountry */ /** @var CouponCountry $couponCountry */
foreach($couponCountries as $couponCountry) { foreach ($couponCountries as $couponCountry) {
$occ = new OrderCouponCountry(); $occ = new OrderCouponCountry();
$occ $occ
@@ -322,7 +320,7 @@ class Coupon extends BaseAction implements EventSubscriberInterface
$couponModules = CouponModuleQuery::create()->filterByCouponId($couponModel->getId())->find(); $couponModules = CouponModuleQuery::create()->filterByCouponId($couponModel->getId())->find();
/** @var CouponModule $couponModule */ /** @var CouponModule $couponModule */
foreach($couponModules as $couponModule) { foreach ($couponModules as $couponModule) {
$ocm = new OrderCouponModule(); $ocm = new OrderCouponModule();
$ocm $ocm
@@ -334,8 +332,7 @@ class Coupon extends BaseAction implements EventSubscriberInterface
} }
$con->commit(); $con->commit();
} } catch (\Exception $ex) {
catch (\Exception $ex) {
$con->rollBack(); $con->rollBack();
throw($ex); throw($ex);

View File

@@ -44,9 +44,9 @@ abstract class AbstractMatchCountries extends ConditionAbstract
parent::__construct($facade); parent::__construct($facade);
} }
protected abstract function getSummaryLabel($cntryStrList, $i18nOperator); abstract protected function getSummaryLabel($cntryStrList, $i18nOperator);
protected abstract function getFormLabel(); abstract protected function getFormLabel();
/** /**
* @inheritdoc * @inheritdoc
@@ -87,6 +87,7 @@ abstract class AbstractMatchCountries extends ConditionAbstract
// The delivery address should match one of the selected countries. // The delivery address should match one of the selected countries.
/* TODO !!!! */ /* TODO !!!! */
return $this->conditionValidator->variableOpComparison( return $this->conditionValidator->variableOpComparison(
$this->facade->getNbArticlesInCart(), $this->facade->getNbArticlesInCart(),
$this->operators[self::COUNTRIES_LIST], $this->operators[self::COUNTRIES_LIST],
@@ -110,7 +111,7 @@ abstract class AbstractMatchCountries extends ConditionAbstract
if (null !== $cntryList = CountryQuery::create()->findPks($cntryIds)) { if (null !== $cntryList = CountryQuery::create()->findPks($cntryIds)) {
/** @var Category $cntry */ /** @var Category $cntry */
foreach($cntryList as $cntry) { foreach ($cntryList as $cntry) {
$cntryStrList .= $cntry->getTitle() . ', '; $cntryStrList .= $cntry->getTitle() . ', ';
} }
@@ -147,4 +148,4 @@ abstract class AbstractMatchCountries extends ConditionAbstract
] ]
); );
} }
} }

View File

@@ -93,12 +93,12 @@ class CartContainsCategories extends ConditionAbstract
$cartItems = $this->facade->getCart()->getCartItems(); $cartItems = $this->facade->getCart()->getCartItems();
/** @var CartItem $cartItem */ /** @var CartItem $cartItem */
foreach($cartItems as $cartItem) { foreach ($cartItems as $cartItem) {
$categories = $cartItem->getProduct()->getCategories(); $categories = $cartItem->getProduct()->getCategories();
/** @var Category $category */ /** @var Category $category */
foreach($categories as $category) { foreach ($categories as $category) {
$catecoryInCart = $this->conditionValidator->variableOpComparison( $catecoryInCart = $this->conditionValidator->variableOpComparison(
$category->getId(), $category->getId(),
$this->operators[self::CATEGORIES_LIST], $this->operators[self::CATEGORIES_LIST],
@@ -156,7 +156,7 @@ class CartContainsCategories extends ConditionAbstract
if (null !== $catList = CategoryQuery::create()->findPks($catIds)) { if (null !== $catList = CategoryQuery::create()->findPks($catIds)) {
/** @var Category $cat */ /** @var Category $cat */
foreach($catList as $cat) { foreach ($catList as $cat) {
$catStrList .= $cat->getTitle() . ', '; $catStrList .= $cat->getTitle() . ', ';
} }

View File

@@ -93,13 +93,12 @@ class CartContainsProducts extends ConditionAbstract
$cartItems = $this->facade->getCart()->getCartItems(); $cartItems = $this->facade->getCart()->getCartItems();
/** @var CartItem $cartItem */ /** @var CartItem $cartItem */
foreach($cartItems as $cartItem) { foreach ($cartItems as $cartItem) {
if ($this->conditionValidator->variableOpComparison( if ($this->conditionValidator->variableOpComparison(
$cartItem->getProduct()->getId(), $cartItem->getProduct()->getId(),
$this->operators[self::PRODUCTS_LIST], $this->operators[self::PRODUCTS_LIST],
$this->values[self::PRODUCTS_LIST])) { $this->values[self::PRODUCTS_LIST])) {
return true; return true;
} }
} }
@@ -149,7 +148,7 @@ class CartContainsProducts extends ConditionAbstract
if (null !== $prodList = ProductQuery::create()->findPks($prodIds)) { if (null !== $prodList = ProductQuery::create()->findPks($prodIds)) {
/** @var Product $prod */ /** @var Product $prod */
foreach($prodList as $prod) { foreach ($prodList as $prod) {
$prodStrList .= $prod->getTitle() . ', '; $prodStrList .= $prod->getTitle() . ', ';
} }

View File

@@ -66,15 +66,15 @@ abstract class ConditionAbstract implements ConditionInterface
} }
/** /**
* @param array $operatorList the list of comparison operator values, as entered in the condition parameter form * @param array $operatorList the list of comparison operator values, as entered in the condition parameter form
* @param string $parameterName the name of the parameter to check * @param string $parameterName the name of the parameter to check
* *
* @return $this * @return $this
* *
* @throws \Thelia\Exception\InvalidConditionOperatorException if the operator value is not in the allowed value * @throws \Thelia\Exception\InvalidConditionOperatorException if the operator value is not in the allowed value
*/ */
protected function checkComparisonOperatorValue($operatorList, $parameterName) { protected function checkComparisonOperatorValue($operatorList, $parameterName)
{
$isOperator1Legit = $this->isOperatorLegit( $isOperator1Legit = $this->isOperatorLegit(
$operatorList[$parameterName], $operatorList[$parameterName],
$this->availableOperators[$parameterName] $this->availableOperators[$parameterName]

View File

@@ -139,7 +139,7 @@ class ForSomeCustomers extends ConditionAbstract
if (null !== $custList = CustomerQuery::create()->findPks($custIds)) { if (null !== $custList = CustomerQuery::create()->findPks($custIds)) {
/** @var Customer $cust */ /** @var Customer $cust */
foreach($custList as $cust) { foreach ($custList as $cust) {
$custStrList .= $cust->getLastname() . ' ' . $cust->getFirstname() . ' ('.$cust->getRef().'), '; $custStrList .= $cust->getLastname() . ' ' . $cust->getFirstname() . ' ('.$cust->getRef().'), ';
} }

View File

@@ -69,8 +69,8 @@ class MatchBillingCountries extends AbstractMatchCountries
return $toolTip; return $toolTip;
} }
protected function getSummaryLabel($cntryStrList, $i18nOperator) { protected function getSummaryLabel($cntryStrList, $i18nOperator)
{
return $this->translator->trans( return $this->translator->trans(
'Only if order billing country is %op% <strong>%countries_list%</strong>', [ 'Only if order billing country is %op% <strong>%countries_list%</strong>', [
'%countries_list%' => $cntryStrList, '%countries_list%' => $cntryStrList,
@@ -79,7 +79,8 @@ class MatchBillingCountries extends AbstractMatchCountries
); );
} }
protected function getFormLabel() { protected function getFormLabel()
{
return $this->translator->trans( return $this->translator->trans(
'Billing coutry is', [], 'condition' 'Billing coutry is', [], 'condition'
); );

View File

@@ -69,8 +69,8 @@ class MatchDeliveryCountries extends AbstractMatchCountries
return $toolTip; return $toolTip;
} }
protected function getSummaryLabel($cntryStrList, $i18nOperator) { protected function getSummaryLabel($cntryStrList, $i18nOperator)
{
return $this->translator->trans( return $this->translator->trans(
'Only if order shipping country is %op% <strong>%countries_list%</strong>', [ 'Only if order shipping country is %op% <strong>%countries_list%</strong>', [
'%countries_list%' => $cntryStrList, '%countries_list%' => $cntryStrList,
@@ -79,7 +79,8 @@ class MatchDeliveryCountries extends AbstractMatchCountries
); );
} }
protected function getFormLabel() { protected function getFormLabel()
{
return $this->translator->trans( return $this->translator->trans(
'Delivery coutry is', [], 'condition' 'Delivery coutry is', [], 'condition'
); );

View File

@@ -26,8 +26,8 @@ class MatchForEveryone extends ConditionAbstract
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function __construct(FacadeInterface $facade) { public function __construct(FacadeInterface $facade)
{
// Define the allowed comparison operators // Define the allowed comparison operators
$this->availableOperators = []; $this->availableOperators = [];

View File

@@ -14,7 +14,6 @@ namespace Thelia\Condition\Implementation;
use Thelia\Condition\Operators; use Thelia\Condition\Operators;
use Thelia\Coupon\FacadeInterface; use Thelia\Coupon\FacadeInterface;
use Thelia\Exception\InvalidConditionOperatorException;
use Thelia\Exception\InvalidConditionValueException; use Thelia\Exception\InvalidConditionValueException;
/** /**

View File

@@ -14,11 +14,7 @@ namespace Thelia\Condition\Implementation;
use Thelia\Condition\Operators; use Thelia\Condition\Operators;
use Thelia\Coupon\FacadeInterface; use Thelia\Coupon\FacadeInterface;
use Thelia\Exception\InvalidConditionOperatorException;
use Thelia\Exception\InvalidConditionValueException; use Thelia\Exception\InvalidConditionValueException;
use Thelia\Model\Category;
use Thelia\Model\CategoryImageQuery;
use Thelia\Model\CategoryQuery;
use Thelia\Tools\DateTimeFormat; use Thelia\Tools\DateTimeFormat;
/** /**
@@ -76,8 +72,7 @@ class StartDate extends ConditionAbstract
} }
$timestamp = $date->getTimestamp(); $timestamp = $date->getTimestamp();
} } else {
else {
$timestamp = $values[self::START_DATE]; $timestamp = $values[self::START_DATE];
} }
@@ -147,7 +142,8 @@ class StartDate extends ConditionAbstract
return $toolTip; return $toolTip;
} }
private function getDateFormat() { private function getDateFormat()
{
return DateTimeFormat::getInstance($this->facade->getRequest())->getFormat("date"); return DateTimeFormat::getInstance($this->facade->getRequest())->getFormat("date");
} }
@@ -177,8 +173,7 @@ class StartDate extends ConditionAbstract
$date->setTimestamp($this->values[self::START_DATE]); $date->setTimestamp($this->values[self::START_DATE]);
$strDate = $date->format($this->getDateFormat()); $strDate = $date->format($this->getDateFormat());
} } else {
else {
$strDate = ''; $strDate = '';
} }
@@ -189,4 +184,4 @@ class StartDate extends ConditionAbstract
'currentValue' => $strDate 'currentValue' => $strDate
]); ]);
} }
} }

View File

@@ -157,12 +157,12 @@ class CouponController extends BaseAdminController
$freeShippingForCountries = $freeShippingForModules = []; $freeShippingForCountries = $freeShippingForModules = [];
/** @var CouponCountry $item */ /** @var CouponCountry $item */
foreach($coupon->getFreeShippingForCountries() as $item) { foreach ($coupon->getFreeShippingForCountries() as $item) {
$freeShippingForCountries[] = $item->getCountryId(); $freeShippingForCountries[] = $item->getCountryId();
} }
/** @var CouponModule $item */ /** @var CouponModule $item */
foreach($coupon->getFreeShippingForModules() as $item) { foreach ($coupon->getFreeShippingForModules() as $item) {
$freeShippingForModules[] = $item->getModuleId(); $freeShippingForModules[] = $item->getModuleId();
} }

View File

@@ -37,9 +37,9 @@ class CouponConsumeEvent extends ActionEvent
/** /**
* Constructor * Constructor
* *
* @param string $code Coupon code * @param string $code Coupon code
* @param float $discount Total discount given by this coupon * @param float $discount Total discount given by this coupon
* @param bool $isValid If Coupon is valid or f Customer meets coupon conditions * @param bool $isValid If Coupon is valid or f Customer meets coupon conditions
* @param bool $freeShipping true if coupon offers free shipping * @param bool $freeShipping true if coupon offers free shipping
*/ */
public function __construct($code, $discount = null, $isValid = null, $freeShipping = false) public function __construct($code, $discount = null, $isValid = null, $freeShipping = false)
@@ -57,6 +57,7 @@ class CouponConsumeEvent extends ActionEvent
public function setFreeShipping($freeShipping) public function setFreeShipping($freeShipping)
{ {
$this->freeShipping = $freeShipping; $this->freeShipping = $freeShipping;
return $this; return $this;
} }

View File

@@ -134,6 +134,7 @@ class CouponCreateOrUpdateEvent extends ActionEvent
public function setPerCustomerUsageCount($perCustomerUsageCount) public function setPerCustomerUsageCount($perCustomerUsageCount)
{ {
$this->perCustomerUsageCount = $perCustomerUsageCount; $this->perCustomerUsageCount = $perCustomerUsageCount;
return $this; return $this;
} }
@@ -146,12 +147,13 @@ class CouponCreateOrUpdateEvent extends ActionEvent
} }
/** /**
* @param array $freeShippingForCountries * @param array $freeShippingForCountries
* @return $this * @return $this
*/ */
public function setFreeShippingForCountries($freeShippingForCountries) public function setFreeShippingForCountries($freeShippingForCountries)
{ {
$this->freeShippingForCountries = $freeShippingForCountries; $this->freeShippingForCountries = $freeShippingForCountries;
return $this; return $this;
} }
@@ -164,12 +166,13 @@ class CouponCreateOrUpdateEvent extends ActionEvent
} }
/** /**
* @param array $freeShippingForMethods * @param array $freeShippingForMethods
* @return $this * @return $this
*/ */
public function setFreeShippingForMethods($freeShippingForMethods) public function setFreeShippingForMethods($freeShippingForMethods)
{ {
$this->freeShippingForMethods = $freeShippingForMethods; $this->freeShippingForMethods = $freeShippingForMethods;
return $this; return $this;
} }

View File

@@ -198,13 +198,13 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface
$freeShippingForCountriesIds = []; $freeShippingForCountriesIds = [];
/** @var CouponCountry $couponCountry */ /** @var CouponCountry $couponCountry */
foreach($coupon->getFreeShippingForCountries() as $couponCountry) { foreach ($coupon->getFreeShippingForCountries() as $couponCountry) {
$freeShippingForCountriesIds[] = $couponCountry->getCountryId(); $freeShippingForCountriesIds[] = $couponCountry->getCountryId();
} }
$freeShippingForModulesIds = []; $freeShippingForModulesIds = [];
/** @var CouponModule $couponModule */ /** @var CouponModule $couponModule */
foreach($coupon->getFreeShippingForModules() as $couponModule) { foreach ($coupon->getFreeShippingForModules() as $couponModule) {
$freeShippingForModulesIds[] = $couponModule->getModuleId(); $freeShippingForModulesIds[] = $couponModule->getModuleId();
} }

View File

@@ -82,13 +82,13 @@ class OrderCoupon extends BaseLoop implements PropelSearchLoopInterface
$freeShippingForCountriesIds = []; $freeShippingForCountriesIds = [];
/** @var OrderCouponCountry $couponCountry */ /** @var OrderCouponCountry $couponCountry */
foreach($orderCoupon->getFreeShippingForCountries() as $couponCountry) { foreach ($orderCoupon->getFreeShippingForCountries() as $couponCountry) {
$freeShippingForCountriesIds[] = $couponCountry->getCountryId(); $freeShippingForCountriesIds[] = $couponCountry->getCountryId();
} }
$freeShippingForModulesIds = []; $freeShippingForModulesIds = [];
/** @var OrderCouponModule $couponModule */ /** @var OrderCouponModule $couponModule */
foreach($orderCoupon->getFreeShippingForModules() as $couponModule) { foreach ($orderCoupon->getFreeShippingForModules() as $couponModule) {
$freeShippingForModulesIds[] = $couponModule->getModuleId(); $freeShippingForModulesIds[] = $couponModule->getModuleId();
} }

View File

@@ -150,7 +150,7 @@ class SmartyAssetsManager
$files = $finder->files()->in($assetSource)->name($file); $files = $finder->files()->in($assetSource)->name($file);
if (! empty($files)) { if (! empty($files)) {
$url = $this->assetsManager->processAsset( $url = $this->assetsManager->processAsset(
$assetSource . DS . $file, $assetSource . DS . $file,
$assetSource . DS . self::$assetsDirectory, $assetSource . DS . self::$assetsDirectory,
@@ -162,8 +162,7 @@ class SmartyAssetsManager
$filters, $filters,
$debug $debug
); );
} } else {
else {
Tlog::getInstance()->addError("Asset $assetSource".DS."$file was not found."); Tlog::getInstance()->addError("Asset $assetSource".DS."$file was not found.");
} }

View File

@@ -78,8 +78,7 @@ class BaseFacade implements FacadeInterface
{ {
try { try {
return AddressQuery::create()->findPk($this->getRequest()->getSession()->getOrder()->getChoosenDeliveryAddress()); return AddressQuery::create()->findPk($this->getRequest()->getSession()->getOrder()->getChoosenDeliveryAddress());
} } catch (\Exception $ex) {
catch(\Exception $ex) {
throw new \LogicException("Failed to get delivery address (" . $ex->getMessage() . ")"); throw new \LogicException("Failed to get delivery address (" . $ex->getMessage() . ")");
} }
} }

View File

@@ -23,8 +23,6 @@ use Thelia\Model\CouponCountry;
use Thelia\Model\CouponCustomerCount; use Thelia\Model\CouponCustomerCount;
use Thelia\Model\CouponCustomerCountQuery; use Thelia\Model\CouponCustomerCountQuery;
use Thelia\Model\Order; use Thelia\Model\Order;
use Thelia\Model\OrderAddress;
use Thelia\Model\OrderAddressQuery;
/** /**
* Manage how Coupons could interact with a Checkout * Manage how Coupons could interact with a Checkout
@@ -117,7 +115,7 @@ class CouponManager
$deliveryCountryId = $deliveryAddress->getCountryId(); $deliveryCountryId = $deliveryAddress->getCountryId();
/** @var CouponCountry $couponCountry */ /** @var CouponCountry $couponCountry */
foreach($couponCountries as $couponCountry) { foreach ($couponCountries as $couponCountry) {
if ($deliveryCountryId == $couponCountry->getCountryId()) { if ($deliveryCountryId == $couponCountry->getCountryId()) {
$countryValid = true; $countryValid = true;
break; break;
@@ -140,7 +138,7 @@ class CouponManager
$shippingModuleId = $order->getDeliveryModuleId(); $shippingModuleId = $order->getDeliveryModuleId();
/** @var CouponModule $couponModule */ /** @var CouponModule $couponModule */
foreach($couponModules as $couponModule) { foreach ($couponModules as $couponModule) {
if ($shippingModuleId == $couponModule->getModuleId()) { if ($shippingModuleId == $couponModule->getModuleId()) {
$moduleValid = true; $moduleValid = true;
break; break;
@@ -273,8 +271,8 @@ class CouponManager
* *
* To call when a coupon is consumed * To call when a coupon is consumed
* *
* @param \Thelia\Model\Coupon $coupon Coupon consumed * @param \Thelia\Model\Coupon $coupon Coupon consumed
* @param int|null $customerId the ID of the ordering customer * @param int|null $customerId the ID of the ordering customer
* *
* @return int Usage left after decremental * @return int Usage left after decremental
*/ */
@@ -318,8 +316,7 @@ class CouponManager
; ;
$ret = $usageLeft - $newCount; $ret = $usageLeft - $newCount;
} } else {
else {
$usageLeft--; $usageLeft--;
$coupon->setMaxUsage($usageLeft); $coupon->setMaxUsage($usageLeft);

View File

@@ -176,6 +176,7 @@ abstract class CouponAbstract implements CouponInterface
public function setPerCustomerUsageCount($perCustomerUsageCount) public function setPerCustomerUsageCount($perCustomerUsageCount)
{ {
$this->perCustomerUsageCount = $perCustomerUsageCount; $this->perCustomerUsageCount = $perCustomerUsageCount;
return $this; return $this;
} }
@@ -187,7 +188,6 @@ abstract class CouponAbstract implements CouponInterface
return $this->perCustomerUsageCount; return $this->perCustomerUsageCount;
} }
/** /**
* Return Coupon code (ex: XMAS) * Return Coupon code (ex: XMAS)
* *
@@ -253,14 +253,16 @@ abstract class CouponAbstract implements CouponInterface
/** /**
* @return array list of country IDs for which shipping is free. All if empty * @return array list of country IDs for which shipping is free. All if empty
*/ */
public function getFreeShippingForCountries() { public function getFreeShippingForCountries()
{
return $this->freeShippingForCountries; return $this->freeShippingForCountries;
} }
/** /**
* @return array list of module IDs for which shipping is free. All if empty * @return array list of module IDs for which shipping is free. All if empty
*/ */
public function getFreeShippingForModules() { public function getFreeShippingForModules()
{
return $this->freeShippingForModules; return $this->freeShippingForModules;
} }

View File

@@ -15,8 +15,6 @@ namespace Thelia\Coupon\Type;
use Propel\Runtime\Collection\ObjectCollection; use Propel\Runtime\Collection\ObjectCollection;
use Thelia\Condition\ConditionCollection; use Thelia\Condition\ConditionCollection;
use Thelia\Coupon\FacadeInterface; use Thelia\Coupon\FacadeInterface;
use Thelia\Model\CouponCountry;
use Thelia\Model\CouponModule;
/** /**
* Represents a Coupon ready to be processed in a Checkout process * Represents a Coupon ready to be processed in a Checkout process
@@ -51,22 +49,22 @@ interface CouponInterface
/** /**
* Set Coupon * Set Coupon
* *
* @param FacadeInterface $facade Provides necessary value from Thelia * @param FacadeInterface $facade Provides necessary value from Thelia
* @param string $code Coupon code (ex: XMAS) * @param string $code Coupon code (ex: XMAS)
* @param string $title Coupon title (ex: Coupon for XMAS) * @param string $title Coupon title (ex: Coupon for XMAS)
* @param string $shortDescription Coupon short description * @param string $shortDescription Coupon short description
* @param string $description Coupon description * @param string $description Coupon description
* @param array $effects Coupon effects params * @param array $effects Coupon effects params
* @param bool $isCumulative If Coupon is cumulative * @param bool $isCumulative If Coupon is cumulative
* @param bool $isRemovingPostage If Coupon is removing postage * @param bool $isRemovingPostage If Coupon is removing postage
* @param bool $isAvailableOnSpecialOffers If available on Product already * @param bool $isAvailableOnSpecialOffers If available on Product already
* on special offer price * on special offer price
* @param bool $isEnabled False if Coupon is disabled by admin * @param bool $isEnabled False if Coupon is disabled by admin
* @param int $maxUsage How many usage left * @param int $maxUsage How many usage left
* @param \Datetime $expirationDate When the Code is expiring * @param \Datetime $expirationDate When the Code is expiring
* @param ObjectCollection $freeShippingForCountries list of countries which shipping is free. All if empty * @param ObjectCollection $freeShippingForCountries list of countries which shipping is free. All if empty
* @param ObjectCollection $freeShippingForModules list of modules for which shipping is free. All if empty * @param ObjectCollection $freeShippingForModules list of modules for which shipping is free. All if empty
* @param bool $perCustomerUsageCount true if usage count is per customer only * @param bool $perCustomerUsageCount true if usage count is per customer only
*/ */
public function set( public function set(
FacadeInterface $facade, FacadeInterface $facade,

View File

@@ -18,13 +18,10 @@ use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotEqualTo; use Symfony\Component\Validator\Constraints\NotEqualTo;
use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
use Thelia\Model\Base\CountryI18n;
use Thelia\Model\Base\CountryQuery; use Thelia\Model\Base\CountryQuery;
use Thelia\Model\Base\LangQuery; use Thelia\Model\Base\LangQuery;
use Thelia\Model\Base\ModuleQuery; use Thelia\Model\Base\ModuleQuery;
use Thelia\Model\CountryI18nQuery;
use Thelia\Model\Module; use Thelia\Model\Module;
use Thelia\Model\ModuleI18nQuery;
use Thelia\Module\BaseModule; use Thelia\Module\BaseModule;
/** /**
@@ -49,7 +46,7 @@ class CouponCreationForm extends BaseForm
$list = CountryQuery::create()->find(); $list = CountryQuery::create()->find();
/** @var Country $item */ /** @var Country $item */
foreach($list as $item) { foreach ($list as $item) {
$countries[$item->getId()] = $item->getTitle(); $countries[$item->getId()] = $item->getTitle();
} }
@@ -62,7 +59,7 @@ class CouponCreationForm extends BaseForm
$list = ModuleQuery::create()->filterByActivate(BaseModule::IS_ACTIVATED)->filterByType(BaseModule::DELIVERY_MODULE_TYPE)->find(); $list = ModuleQuery::create()->filterByActivate(BaseModule::IS_ACTIVATED)->filterByType(BaseModule::DELIVERY_MODULE_TYPE)->find();
/** @var Module $item */ /** @var Module $item */
foreach($list as $item) { foreach ($list as $item) {
$modules[$item->getId()] = $item->getTitle(); $modules[$item->getId()] = $item->getTitle();
} }

View File

@@ -19,7 +19,6 @@ use Thelia\Condition\Implementation\MatchForTotalAmount;
use Thelia\Condition\Operators; use Thelia\Condition\Operators;
use Thelia\Coupon\Type\RemoveXAmount; use Thelia\Coupon\Type\RemoveXAmount;
use Thelia\Model\Coupon; use Thelia\Model\Coupon;
use Thelia\Model\CouponCountry;
use Thelia\Model\CurrencyQuery; use Thelia\Model\CurrencyQuery;
use Thelia\Model\Order; use Thelia\Model\Order;