Skip to content

Commit

Permalink
Merge pull request #5 from 036/patch-1
Browse files Browse the repository at this point in the history
Correct typo
  • Loading branch information
mpociot authored Dec 18, 2018
2 parents bb6a6f0 + 80f7f5d commit 995ccf2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Rules/Voucher.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Voucher implements Rule
{
protected $isInvalid = false;
protected $isExpired = false;
protected $wasRedeemd = false;
protected $wasRedeemed = false;

/**
* Determine if the validation rule passes.
Expand All @@ -37,7 +37,7 @@ public function passes($attribute, $value)
$this->isExpired = true;
return false;
} catch (VoucherAlreadyRedeemed $exception) {
$this->wasRedeemd = true;
$this->wasRedeemed = true;
return false;
}

Expand All @@ -51,12 +51,12 @@ public function passes($attribute, $value)
*/
public function message()
{
if ($this->wasRedeemd) {
if ($this->wasRedeemed) {
return trans('vouchers::validation.code_redeemed');
}
if ($this->isExpired) {
return trans('vouchers::validation.code_expired');
}
return trans('vouchers::validation.code_invalid');
}
}
}

0 comments on commit 995ccf2

Please sign in to comment.