| Conditions | 5 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 36 | public function __construct($data) |
||
| 37 | { |
||
| 38 | if(!is_array($data)) { |
||
| 39 | $this->type = T_STRING; |
||
| 40 | $this->value = $data; |
||
| 41 | } else { |
||
| 42 | $this->type = $data[0]; |
||
| 43 | $this->value = isset($data[1]) ? $data[1] : null; |
||
| 44 | } |
||
| 45 | |||
| 46 | // reduce multiple spaces to one |
||
| 47 | if(T_WHITESPACE === $this->type && preg_match('/^\s*$/', $this->value)) { |
||
| 48 | $this->value = ' '; |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 81 | } |