| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | 26 | public function isValid($value) |
|
| 49 | { |
||
| 50 | 26 | $this->setValue($value); |
|
| 51 | |||
| 52 | // If the strict parameter is set to TRUE, base64_decode() returns false, |
||
| 53 | // if the input contains characters from outside the base64 alphabet. |
||
| 54 | |||
| 55 | 26 | if (false === base64_decode($this->getValue(), true)) { |
|
| 56 | 2 | $this->error(self::INVALID_ENCODING); |
|
| 57 | |||
| 58 | 2 | return false; |
|
| 59 | } |
||
| 60 | |||
| 61 | 24 | return true; |
|
| 62 | } |
||
| 64 |