Skip to content

Commit

Permalink
- Fixed deallocation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercd100 committed Aug 24, 2018
1 parent 4103d8e commit 779b54c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 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.

### 4.0.1
- Fixed deallocation issue

### 4.0.0
- Deallocation logic

Expand Down
8 changes: 2 additions & 6 deletions src/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,8 @@ public function allocate($quantity, $add = false)
public function deallocate($quantity, $sub = false)
{
$used = $this->used();
if ($used - $quantity >= 0) {
if(!$sub) {
$this->error($this->deallocateMessage($used, $quantity));
} else {
$this->sub($quantity);
}
if ($used - $quantity >= 0 && $sub) {
$this->sub($quantity);
}

$this->deallocateSuccess($quantity);
Expand Down

0 comments on commit 779b54c

Please sign in to comment.