This commit is contained in:
Manuel Raynaud
2014-01-10 11:41:55 +01:00
parent ab0fbb6e27
commit 9d0121f321
54 changed files with 220 additions and 290 deletions

View File

@@ -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
*

View File

@@ -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;
}
}

View File

@@ -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;
}
}
}

View File

@@ -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();
}
}

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -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;
}
}
}