| Conditions | 5 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | public function parseContextual($value) |
||
| 45 | { |
||
| 46 | if (is_integer($value)) { |
||
| 47 | return boolval($value); |
||
| 48 | } |
||
| 49 | |||
| 50 | if (is_bool($value)) { |
||
| 51 | return $value; |
||
| 52 | } |
||
| 53 | |||
| 54 | if ($this->isNegativeMatch($value)) { |
||
| 55 | return false; |
||
| 56 | } |
||
| 57 | |||
| 58 | if ($this->isPositiveMatch($value)) { |
||
| 59 | return true; |
||
| 60 | } |
||
| 61 | |||
| 62 | throw new SchemaAttributeParseException($this, "Provided value '$value' is not a boolean"); |
||
| 63 | } |
||
| 64 | } |