There is an 'optimization' to skip validation if no rules are defined in parse():
|
if (!$skipValidation && !empty($this->rules)) { |
|
// Validate all of the rules that were specified: |
|
$this->validate($token, true); |
|
} |
but validate() adds NotExpired rule implicitly:
|
if (!$this->nonExpiring) { |
|
// By default, we disallow expired tokens |
|
$rules[] = new NotExpired(); |
|
} |
so the check gets skipped if no other rules are defined
Proposal: remove optimization, check only for the boolean