| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function accept($signatureTime, $referenceTime) |
||
| 23 | { |
||
| 24 | if (!$this->enabled) { |
||
| 25 | return true; |
||
| 26 | } |
||
| 27 | |||
| 28 | // We validate only now the signatureTime because before we are not sure we need it. |
||
| 29 | if (!is_numeric($signatureTime)) { |
||
| 30 | throw new ExpiredSignatureException(sprintf('Signature TTL "%s" is not valid', $signatureTime)); |
||
| 31 | } |
||
| 32 | |||
| 33 | return $this->lifetime >= abs($referenceTime - $signatureTime); |
||
| 34 | } |
||
| 35 | |||
| 43 |