1 | <?php |
||
21 | class DecodeJSON extends FilterRule |
||
22 | { |
||
23 | /** |
||
24 | * @var bool When `true`, decoded objects will be converted into associative arrays |
||
25 | */ |
||
26 | protected $assoc; |
||
27 | |||
28 | /** |
||
29 | * @var int Decode recursion depth |
||
30 | */ |
||
31 | protected $depth; |
||
32 | |||
33 | /** |
||
34 | * @var int Bitmask of JSON decode options |
||
35 | */ |
||
36 | protected $options; |
||
37 | |||
38 | /** |
||
39 | * Set required params for JSON decoding |
||
40 | * |
||
41 | * @param bool $assoc When `true`, decoded objects will be converted into associative arrays |
||
42 | * @param int $depth Decode recursion dept |
||
43 | * @param int $options Bitmask of JSON decode options |
||
44 | * @see http://php.net/manual/en/function.json-decode.php More information about the parameters |
||
45 | */ |
||
46 | 11 | public function __construct($assoc, $depth, $options) |
|
52 | |||
53 | /** |
||
54 | * Decodes the value JSON |
||
55 | * |
||
56 | * @param mixed $value |
||
57 | * @return mixed |
||
58 | */ |
||
59 | 11 | public function filter($value) |
|
67 | } |
||
68 |