16
16
*/
17
17
class PHPEncoder
18
18
{
19
- /** @var Encoder\Encoder[] List of used encoders */
19
+ /** @var Encoder\Encoder[] List of value encoders */
20
20
private $ encoders ;
21
21
22
22
/** @var array List of defined encoder option values. */
@@ -33,13 +33,13 @@ class PHPEncoder
33
33
/**
34
34
* Creates a new PHPEncoder instance.
35
35
*
36
- * It's possible to define the list of default options for the encoder in
37
- * the constructor. You may also customize the list of used encoders by
38
- * providing an array of encoders. If null is provided, a list of default of
39
- * encoders will be used instead .
36
+ * Optionally, you can provide a list of default options to the constructor
37
+ * as an associative array. If you do not want to use the default list of
38
+ * encoders supplied with the library, you may also provide a list of
39
+ * value encoders to the constructor .
40
40
*
41
41
* @param array $options List of encoder options
42
- * @param null|Encoder\Encoder [] $encoders List of encoders to use
42
+ * @param null|Encoder[] $encoders List of encoders to use or null for default
43
43
*/
44
44
public function __construct (array $ options = [], array $ encoders = null )
45
45
{
@@ -67,10 +67,10 @@ public function __construct(array $options = [], array $encoders = null)
67
67
/**
68
68
* Adds a new encoder.
69
69
*
70
- * Note that values are always encoded by the first encoder that supports
71
- * it. Thus, all objects will be caught by the ObjectEncoder, for example.
72
- * If you want the encoder to be tried first, set the $prepend parameter
73
- * true which adds it to beginning of the list .
70
+ * Values are always encoded by the first encoder that supports encoding
71
+ * that type of value. By setting the second optional parameter to true,
72
+ * you can prepend the encoder to the list to ensure that it will be tested
73
+ * first .
74
74
*
75
75
* @param Encoder\Encoder $encoder Encoder for encoding values
76
76
* @param boolean $prepend True to prepend the encoder to the list, false to add it as last
0 commit comments