Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
lukepolo authored and StyleCIBot committed Jan 15, 2019
1 parent ed4d082 commit 036de90
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Coupons/Fixed.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function discount($throwErrors = false)
$subTotal = app(LaraCart::SERVICE)->subTotal(false);

if (config('laracart.discountOnFees', false)) {
$subTotal = $subTotal + app(LaraCart::SERVICE)->feeTotals(false);
$subTotal = $subTotal + app(LaraCart::SERVICE)->feeTotals(false);
}

$total = $subTotal - $this->value;
Expand Down
3 changes: 2 additions & 1 deletion src/Coupons/Percentage.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ class Percentage implements CouponContract
* @param $code
* @param $value
* @param array $options
*
* @throws \Exception
*/
public function __construct($code, $value, $options = [])
{
$this->code = $code;
if($value > 1) {
if ($value > 1) {
throw new CouponException('Invalid value for a percentage coupon. The value must be between 0 and 1.');
}
$this->value = $value;
Expand Down
3 changes: 0 additions & 3 deletions tests/CouponsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public function testAddPercentageCoupon()

$percentCoupon = new LukePOLO\LaraCart\Coupons\Percentage('10%OFF', '.1');



$this->laracart->addCoupon($percentCoupon);

$this->assertEquals($percentCoupon, $this->laracart->findCoupon('10%OFF'));
Expand Down Expand Up @@ -436,7 +434,6 @@ public function testFixedCouponWithFeeWithTotalLessThanCoupon()

$this->assertEquals('500', $fixedCoupon->discount());


$this->app['config']->set('laracart.discountOnFees', true);

$percentCoupon = new LukePOLO\LaraCart\Coupons\Percentage('100% Off', 1);
Expand Down

0 comments on commit 036de90

Please sign in to comment.