| Conditions | 5 |
| Paths | 16 |
| Total Lines | 7 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 1 | public function build(&$parent = null) |
|
| 30 | { |
||
| 31 | 1 | $built = is_null($this->value) ? null : $this->value->build(); |
|
| 32 | 1 | $stringKey = is_string($built) && Regex::isProperlyQuoted($built) ? trim($built, '\'" '): $built; |
|
| 33 | 1 | $key = json_encode($stringKey, JSON_PARTIAL_OUTPUT_ON_ERROR|JSON_UNESCAPED_SLASHES); |
|
| 34 | 1 | if (empty($key)) throw new \Exception("Cant serialize complex key: ".var_export($this->value, true)); |
|
| 35 | 1 | $parent->{trim($key, '\'" ')} = null; |
|
| 36 | 1 | } |
|
| 42 | } |