@@ -467,9 +467,9 @@ |
||
| 467 | 467 | /** |
| 468 | 468 | * Gets the total amount discounted |
| 469 | 469 | * |
| 470 | - * @param bool|true $format |
|
| 470 | + * @param boolean $format |
|
| 471 | 471 | * |
| 472 | - * @return int|string |
|
| 472 | + * @return string |
|
| 473 | 473 | */ |
| 474 | 474 | public function totalDiscount($format = true) |
| 475 | 475 | { |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @param $id |
| 35 | 35 | * @param $name |
| 36 | - * @param $qty |
|
| 37 | - * @param $price |
|
| 36 | + * @param integer $qty |
|
| 37 | + * @param string $price |
|
| 38 | 38 | * @param array $options |
| 39 | - * @param bool|true $taxable |
|
| 39 | + * @param boolean $taxable |
|
| 40 | 40 | * @param bool|false $lineItem |
| 41 | 41 | */ |
| 42 | 42 | public function __construct($id, $name, $qty, $price, $options = [], $taxable = true, $lineItem = false) |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * |
| 113 | 113 | * @param array $subItem |
| 114 | 114 | * |
| 115 | - * @return string $itemHash |
|
| 115 | + * @return CartSubItem $itemHash |
|
| 116 | 116 | */ |
| 117 | 117 | public function addSubItem(array $subItem) |
| 118 | 118 | { |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | * Gets the totals for the options |
| 181 | 181 | * |
| 182 | 182 | * @param bool|false $tax |
| 183 | - * @param bool|true $format |
|
| 183 | + * @param boolean $format |
|
| 184 | 184 | * |
| 185 | 185 | * @return int|mixed|string |
| 186 | 186 | */ |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | /** |
| 208 | 208 | * Gets the discount of an item |
| 209 | 209 | * |
| 210 | - * @param bool|true $format |
|
| 210 | + * @param boolean $format |
|
| 211 | 211 | * |
| 212 | 212 | * @return mixed|null|string |
| 213 | 213 | */ |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | $this->id = $id; |
| 45 | 45 | $this->qty = $qty; |
| 46 | 46 | $this->name = $name; |
| 47 | - foreach($options as $option => $value) { |
|
| 47 | + foreach ($options as $option => $value) { |
|
| 48 | 48 | $this->$option = $value; |
| 49 | 49 | } |
| 50 | 50 | $this->taxable = $taxable; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function __construct($options) |
| 27 | 27 | { |
| 28 | - foreach($options as $option => $value) { |
|
| 28 | + foreach ($options as $option => $value) { |
|
| 29 | 29 | array_set($this->options, $option, $value); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $price = $this->price; |
| 55 | 55 | |
| 56 | - if(isset($this->items)) { |
|
| 56 | + if (isset($this->items)) { |
|
| 57 | 57 | foreach ($this->items as $item) { |
| 58 | 58 | $price += $item->getPrice(false, false) + $item->subItemsTotal(false, false); |
| 59 | 59 | } |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace LukePOLO\LaraCart; |
| 4 | 4 | |
| 5 | 5 | use Illuminate\Support\ServiceProvider; |
| 6 | -use LukePOLO\LaraCart\Contracts\LaraCartContract; |
|
| 7 | 6 | |
| 8 | 7 | /** |
| 9 | 8 | * Class LaraCartServiceProvider |
@@ -38,21 +38,21 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function register() |
| 40 | 40 | { |
| 41 | - $this->app->singleton('laracart', function ($app) { |
|
| 41 | + $this->app->singleton('laracart', function($app) { |
|
| 42 | 42 | return new LaraCart(); |
| 43 | 43 | } |
| 44 | 44 | ); |
| 45 | 45 | |
| 46 | 46 | $this->app->bind( |
| 47 | 47 | LaraCart::HASH, |
| 48 | - function ($app, $data) { |
|
| 48 | + function($app, $data) { |
|
| 49 | 49 | return md5(json_encode($data)); |
| 50 | 50 | } |
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | 53 | $this->app->bind( |
| 54 | 54 | LaraCart::RANHASH, |
| 55 | - function () { |
|
| 55 | + function() { |
|
| 56 | 56 | return str_random(40); |
| 57 | 57 | } |
| 58 | 58 | ); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | try { |
| 28 | 28 | return $this->$option; |
| 29 | - } catch(\ErrorException $e) { |
|
| 29 | + } catch (\ErrorException $e) { |
|
| 30 | 30 | return array_get($this->options, $option); |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function __set($option, $value) |
| 44 | 44 | { |
| 45 | - if(is_callable(array($this, 'generateHash'))) { |
|
| 45 | + if (is_callable(array($this, 'generateHash'))) { |
|
| 46 | 46 | $this->generateHash(); |
| 47 | 47 | } |
| 48 | 48 | |