19
19
class JsonDecode implements DecoderInterface
20
20
{
21
21
/**
22
- * Specifies if the returned result should be an associative array or a nested stdClass object hierarchy
23
- * @var bool
22
+ * Specifies if the returned result should be an associative array or a nested stdClass object hierarchy.
23
+ *
24
+ * @var Boolean
24
25
*/
25
26
private $ associative ;
26
27
27
28
/**
28
- * Specifies the recursion depth
29
- * @var int
29
+ * Specifies the recursion depth.
30
+ *
31
+ * @var integer
30
32
*/
31
33
private $ recursionDepth ;
32
34
@@ -36,8 +38,8 @@ class JsonDecode implements DecoderInterface
36
38
/**
37
39
* Constructs a new JsonDecode instance.
38
40
*
39
- * @param bool $associative True to return the result associative array, false for a nested stdClass hierarchy.
40
- * @param int $depth Specifies the recursion depth
41
+ * @param Boolean $associative True to return the result associative array, false for a nested stdClass hierarchy
42
+ * @param integer $depth Specifies the recursion depth
41
43
*/
42
44
public function __construct ($ associative = false , $ depth = 512 )
43
45
{
@@ -46,7 +48,7 @@ public function __construct($associative = false, $depth = 512)
46
48
}
47
49
48
50
/**
49
- * Returns the last decoding error (if any)
51
+ * Returns the last decoding error (if any).
50
52
*
51
53
* @return integer
52
54
*
@@ -58,9 +60,11 @@ public function getLastError()
58
60
}
59
61
60
62
/**
61
- * @param string $data The encoded JSON string to decode
62
- * @param string $format Must be set to JsonEncoder::FORMAT
63
- * @param array $context An optional set of options for the JSON decoder; see below.
63
+ * Decodes data.
64
+ *
65
+ * @param string $data The encoded JSON string to decode
66
+ * @param string $format Must be set to JsonEncoder::FORMAT
67
+ * @param array $context An optional set of options for the JSON decoder; see below
64
68
*
65
69
* The $context array is a simple key=>value array, with the following supported keys:
66
70
*
@@ -74,7 +78,7 @@ public function getLastError()
74
78
* If not specified, this method will use the default set in JsonDecode::__construct
75
79
*
76
80
* json_decode_options: integer
77
- * Specifies additional options as per documentation for json_decode. Only supported with PHP 5.4.0 and higher.
81
+ * Specifies additional options as per documentation for json_decode. Only supported with PHP 5.4.0 and higher
78
82
*
79
83
* @return mixed
80
84
*
@@ -108,9 +112,10 @@ public function supportsDecoding($format)
108
112
}
109
113
110
114
/**
111
- * Merge the default options of the Json Decoder with the passed context.
115
+ * Merges the default options of the Json Decoder with the passed context.
112
116
*
113
117
* @param array $context
118
+ *
114
119
* @return array
115
120
*/
116
121
private function resolveContext (array $ context )
0 commit comments