Skip to content

Commit

Permalink
Fixed adding or subtracting licenses by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercd100 committed Sep 16, 2017
1 parent 9254e28 commit b113c43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to `laravel-licenser` will be documented in this file.

### 1.0.2
- Fixed adding or subtracting licenses by 0

### 1.0.1
- Added publish option for older versions of Laravel.
- Fixed setting a new value for the license amount.
Expand Down
6 changes: 3 additions & 3 deletions src/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ abstract protected function subtracted();
*/
final public function add($quantity = 1)
{
if (!is_int($quantity) || $quantity <= 0) {
if (!is_int($quantity) || $quantity < 0) {
throw new LicenseException("Quantity must be a positive integer.");
}

Expand All @@ -161,7 +161,7 @@ final public function add($quantity = 1)
*/
final public function sub($quantity = 1)
{
if (!is_int($quantity) || $quantity <= 0) {
if (!is_int($quantity) || $quantity < 0) {
throw new LicenseException("Quantity must be a positive integer.");
}

Expand All @@ -187,7 +187,7 @@ final public function sub($quantity = 1)
*/
final public function set($quantity)
{
if (!is_int($quantity) || $quantity <= 0) {
if (!is_int($quantity) || $quantity < 0) {
throw new LicenseException("Quantity must be a positive integer.");
}

Expand Down

0 comments on commit b113c43

Please sign in to comment.