Skip to content

Commit

Permalink
Misc fixes (#122)
Browse files Browse the repository at this point in the history
* fixing some type hinting

* updating read me a bit

* allow user to add via item id as well as item model

* showing more of the bindings availalble

* adding the exceptiong

* removing scrutinzier,

* hotfix
  • Loading branch information
lukepolo committed Apr 29, 2016
1 parent 1cfd2b1 commit a80ee64
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Traits/CartOptionsMagicMethodsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ public function __set($option, $value)
throw new InvalidPrice('The price must be a valid number');
}
break;
case CartItem::ITEM_TAX:
if (!is_numeric($value) || $value > 1) {
throw new InvalidTaxableValue('The tax must be a float less than 1');
}
break;
// Bad code , will need to look at later
// case CartItem::ITEM_TAX:
// if (!is_numeric($value) || $value > 1) {
// throw new InvalidTaxableValue('The tax must be a float less than 1');
// }
// break;
case CartItem::ITEM_TAXABLE:
if(!is_bool($value)) {
throw new InvalidTaxableValue('The taxable option must be a boolean');
Expand Down

0 comments on commit a80ee64

Please sign in to comment.