Applied php-cs-fixer
This commit is contained in:
@@ -78,8 +78,7 @@ class BaseFacade implements FacadeInterface
|
||||
{
|
||||
try {
|
||||
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() . ")");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,6 @@ use Thelia\Model\CouponCountry;
|
||||
use Thelia\Model\CouponCustomerCount;
|
||||
use Thelia\Model\CouponCustomerCountQuery;
|
||||
use Thelia\Model\Order;
|
||||
use Thelia\Model\OrderAddress;
|
||||
use Thelia\Model\OrderAddressQuery;
|
||||
|
||||
/**
|
||||
* Manage how Coupons could interact with a Checkout
|
||||
@@ -117,7 +115,7 @@ class CouponManager
|
||||
$deliveryCountryId = $deliveryAddress->getCountryId();
|
||||
|
||||
/** @var CouponCountry $couponCountry */
|
||||
foreach($couponCountries as $couponCountry) {
|
||||
foreach ($couponCountries as $couponCountry) {
|
||||
if ($deliveryCountryId == $couponCountry->getCountryId()) {
|
||||
$countryValid = true;
|
||||
break;
|
||||
@@ -140,7 +138,7 @@ class CouponManager
|
||||
$shippingModuleId = $order->getDeliveryModuleId();
|
||||
|
||||
/** @var CouponModule $couponModule */
|
||||
foreach($couponModules as $couponModule) {
|
||||
foreach ($couponModules as $couponModule) {
|
||||
if ($shippingModuleId == $couponModule->getModuleId()) {
|
||||
$moduleValid = true;
|
||||
break;
|
||||
@@ -273,8 +271,8 @@ class CouponManager
|
||||
*
|
||||
* To call when a coupon is consumed
|
||||
*
|
||||
* @param \Thelia\Model\Coupon $coupon Coupon consumed
|
||||
* @param int|null $customerId the ID of the ordering customer
|
||||
* @param \Thelia\Model\Coupon $coupon Coupon consumed
|
||||
* @param int|null $customerId the ID of the ordering customer
|
||||
*
|
||||
* @return int Usage left after decremental
|
||||
*/
|
||||
@@ -318,8 +316,7 @@ class CouponManager
|
||||
;
|
||||
|
||||
$ret = $usageLeft - $newCount;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$usageLeft--;
|
||||
|
||||
$coupon->setMaxUsage($usageLeft);
|
||||
|
||||
@@ -176,6 +176,7 @@ abstract class CouponAbstract implements CouponInterface
|
||||
public function setPerCustomerUsageCount($perCustomerUsageCount)
|
||||
{
|
||||
$this->perCustomerUsageCount = $perCustomerUsageCount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -187,7 +188,6 @@ abstract class CouponAbstract implements CouponInterface
|
||||
return $this->perCustomerUsageCount;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getFreeShippingForCountries() {
|
||||
public function getFreeShippingForCountries()
|
||||
{
|
||||
return $this->freeShippingForCountries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array list of module IDs for which shipping is free. All if empty
|
||||
*/
|
||||
public function getFreeShippingForModules() {
|
||||
public function getFreeShippingForModules()
|
||||
{
|
||||
return $this->freeShippingForModules;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@ namespace Thelia\Coupon\Type;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Thelia\Condition\ConditionCollection;
|
||||
use Thelia\Coupon\FacadeInterface;
|
||||
use Thelia\Model\CouponCountry;
|
||||
use Thelia\Model\CouponModule;
|
||||
|
||||
/**
|
||||
* Represents a Coupon ready to be processed in a Checkout process
|
||||
@@ -51,22 +49,22 @@ interface CouponInterface
|
||||
/**
|
||||
* Set Coupon
|
||||
*
|
||||
* @param FacadeInterface $facade Provides necessary value from Thelia
|
||||
* @param string $code Coupon code (ex: XMAS)
|
||||
* @param string $title Coupon title (ex: Coupon for XMAS)
|
||||
* @param string $shortDescription Coupon short description
|
||||
* @param string $description Coupon description
|
||||
* @param array $effects Coupon effects params
|
||||
* @param bool $isCumulative If Coupon is cumulative
|
||||
* @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 FacadeInterface $facade Provides necessary value from Thelia
|
||||
* @param string $code Coupon code (ex: XMAS)
|
||||
* @param string $title Coupon title (ex: Coupon for XMAS)
|
||||
* @param string $shortDescription Coupon short description
|
||||
* @param string $description Coupon description
|
||||
* @param array $effects Coupon effects params
|
||||
* @param bool $isCumulative If Coupon is cumulative
|
||||
* @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 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 bool $perCustomerUsageCount true if usage count is per customer only
|
||||
* @param bool $perCustomerUsageCount true if usage count is per customer only
|
||||
*/
|
||||
public function set(
|
||||
FacadeInterface $facade,
|
||||
|
||||
Reference in New Issue
Block a user