| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | protected function doValidate($certInfo) |
||
| 23 | { |
||
| 24 | |||
| 25 | $validFrom = date('d.m.Y H:i:s', $certInfo['validFrom_time_t']); |
||
| 26 | $validTo = date('d.m.Y H:i:s', $certInfo['validTo_time_t']); |
||
| 27 | |||
| 28 | if ($certInfo['validFrom_time_t'] > time() || $certInfo['validTo_time_t'] < time()) { |
||
| 29 | $errorMessage = 'Certificate is expired. [' . $validFrom . ' - ' . $validTo . ']'; |
||
| 30 | throw new ValidationFailedException($errorMessage); |
||
| 31 | } elseif ($certInfo['validTo_time_t'] < strtotime('+' . $this->expireWarningTime . 'days')) { |
||
| 32 | $errorMessage = 'Certificate warning, expires in less than ' . $this->expireWarningTime . ' days. Certificate expires at: ' . $validTo; |
||
| 33 | throw new ValidationFailedException($errorMessage); |
||
| 34 | } |
||
| 35 | |||
| 36 | } |
||
| 37 | } |
||
| 38 |