Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function encode($value) |
||
35 | { |
||
36 | if (is_resource($value)) { |
||
37 | throw new InvalidArgumentException('Value must not be a resource.', 500); |
||
38 | } |
||
39 | |||
40 | $encoded = json_encode($value, $this->options, $this->depth); |
||
41 | |||
42 | if (false === $this->error->hasError()) { |
||
43 | return $encoded; |
||
44 | } |
||
45 | |||
46 | $this->error->throwException(); |
||
47 | } |
||
48 | } |
||
49 |