@@ -19,25 +19,25 @@ discard block |
||
19 | 19 | const TYPE_UNKNOWN = 'unknown type'; |
20 | 20 | const TYPE_CALLABLE = 'callable'; |
21 | 21 | |
22 | - /** |
|
23 | - * @var string |
|
24 | - */ |
|
22 | + /** |
|
23 | + * @var string |
|
24 | + */ |
|
25 | 25 | protected $string; |
26 | 26 | |
27 | - /** |
|
28 | - * @var mixed |
|
29 | - */ |
|
27 | + /** |
|
28 | + * @var mixed |
|
29 | + */ |
|
30 | 30 | protected $value; |
31 | 31 | |
32 | - /** |
|
33 | - * @var string |
|
34 | - */ |
|
32 | + /** |
|
33 | + * @var string |
|
34 | + */ |
|
35 | 35 | protected $type; |
36 | 36 | |
37 | - /** |
|
38 | - * @param mixed $value |
|
39 | - * @param array|null $serialized |
|
40 | - */ |
|
37 | + /** |
|
38 | + * @param mixed $value |
|
39 | + * @param array|null $serialized |
|
40 | + */ |
|
41 | 41 | public function __construct($value, $serialized=null) |
42 | 42 | { |
43 | 43 | if(is_array($serialized)) |
@@ -50,26 +50,26 @@ discard block |
||
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | - /** |
|
54 | - * Creates a new variable info instance from a PHP variable |
|
55 | - * of any type. |
|
56 | - * |
|
57 | - * @param mixed $variable |
|
58 | - * @return VariableInfo |
|
59 | - */ |
|
53 | + /** |
|
54 | + * Creates a new variable info instance from a PHP variable |
|
55 | + * of any type. |
|
56 | + * |
|
57 | + * @param mixed $variable |
|
58 | + * @return VariableInfo |
|
59 | + */ |
|
60 | 60 | public static function fromVariable($variable) : VariableInfo |
61 | 61 | { |
62 | 62 | return new VariableInfo($variable); |
63 | 63 | } |
64 | 64 | |
65 | - /** |
|
66 | - * Restores a variable info instance using a previously serialized |
|
67 | - * array using the serialize() method. |
|
68 | - * |
|
69 | - * @param array $serialized |
|
70 | - * @return VariableInfo |
|
71 | - * @see VariableInfo::serialize() |
|
72 | - */ |
|
65 | + /** |
|
66 | + * Restores a variable info instance using a previously serialized |
|
67 | + * array using the serialize() method. |
|
68 | + * |
|
69 | + * @param array $serialized |
|
70 | + * @return VariableInfo |
|
71 | + * @see VariableInfo::serialize() |
|
72 | + */ |
|
73 | 73 | public static function fromSerialized(array $serialized) : VariableInfo |
74 | 74 | { |
75 | 75 | return new VariableInfo(null, $serialized); |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | return $this->value; |
101 | 101 | } |
102 | 102 | |
103 | - /** |
|
104 | - * The variable type - this is the same string that |
|
105 | - * is returned by the PHP function `gettype`. |
|
106 | - * |
|
107 | - * @return string |
|
108 | - */ |
|
103 | + /** |
|
104 | + * The variable type - this is the same string that |
|
105 | + * is returned by the PHP function `gettype`. |
|
106 | + * |
|
107 | + * @return string |
|
108 | + */ |
|
109 | 109 | public function getType() : string |
110 | 110 | { |
111 | 111 | return $this->type; |
@@ -119,13 +119,13 @@ discard block |
||
119 | 119 | ); |
120 | 120 | } |
121 | 121 | |
122 | - /** |
|
123 | - * Whether to prepend the variable type before the value, |
|
124 | - * like the var_dump function. Example: <code>string "Some text"</code>. |
|
125 | - * |
|
126 | - * @param bool $enable |
|
127 | - * @return VariableInfo |
|
128 | - */ |
|
122 | + /** |
|
123 | + * Whether to prepend the variable type before the value, |
|
124 | + * like the var_dump function. Example: <code>string "Some text"</code>. |
|
125 | + * |
|
126 | + * @param bool $enable |
|
127 | + * @return VariableInfo |
|
128 | + */ |
|
129 | 129 | public function enableType(bool $enable=true) : VariableInfo |
130 | 130 | { |
131 | 131 | return $this->setOption('prepend-type', $enable); |
@@ -21,25 +21,25 @@ discard block |
||
21 | 21 | */ |
22 | 22 | class XMLHelper_Converter_Decorator implements \JsonSerializable |
23 | 23 | { |
24 | - /** |
|
25 | - * @var \SimpleXMLElement |
|
26 | - */ |
|
24 | + /** |
|
25 | + * @var \SimpleXMLElement |
|
26 | + */ |
|
27 | 27 | private $subject; |
28 | 28 | |
29 | 29 | const DEF_DEPTH = 512; |
30 | 30 | |
31 | - /** |
|
32 | - * @var array |
|
33 | - */ |
|
31 | + /** |
|
32 | + * @var array |
|
33 | + */ |
|
34 | 34 | private $options = array( |
35 | 35 | '@attributes' => true, |
36 | 36 | '@text' => true, |
37 | 37 | 'depth' => self::DEF_DEPTH |
38 | 38 | ); |
39 | 39 | |
40 | - /** |
|
41 | - * @var array |
|
42 | - */ |
|
40 | + /** |
|
41 | + * @var array |
|
42 | + */ |
|
43 | 43 | protected $result = array(); |
44 | 44 | |
45 | 45 | public function __construct(\SimpleXMLElement $element) |
@@ -47,36 +47,36 @@ discard block |
||
47 | 47 | $this->subject = $element; |
48 | 48 | } |
49 | 49 | |
50 | - /** |
|
51 | - * Whether to use the `@attributes` key to store element attributes. |
|
52 | - * |
|
53 | - * @param bool $bool |
|
54 | - * @return XMLHelper_Converter_Decorator |
|
55 | - */ |
|
50 | + /** |
|
51 | + * Whether to use the `@attributes` key to store element attributes. |
|
52 | + * |
|
53 | + * @param bool $bool |
|
54 | + * @return XMLHelper_Converter_Decorator |
|
55 | + */ |
|
56 | 56 | public function useAttributes(bool $bool) : XMLHelper_Converter_Decorator |
57 | 57 | { |
58 | 58 | $this->options['@attributes'] = (bool)$bool; |
59 | 59 | return $this; |
60 | 60 | } |
61 | 61 | |
62 | - /** |
|
63 | - * Whether to use the `@text` key to store the node text. |
|
64 | - * |
|
65 | - * @param bool $bool |
|
66 | - * @return XMLHelper_Converter_Decorator |
|
67 | - */ |
|
62 | + /** |
|
63 | + * Whether to use the `@text` key to store the node text. |
|
64 | + * |
|
65 | + * @param bool $bool |
|
66 | + * @return XMLHelper_Converter_Decorator |
|
67 | + */ |
|
68 | 68 | public function useText(bool $bool) : XMLHelper_Converter_Decorator |
69 | 69 | { |
70 | 70 | $this->options['@text'] = (bool)$bool; |
71 | 71 | return $this; |
72 | 72 | } |
73 | 73 | |
74 | - /** |
|
75 | - * Set the maximum depth to parse in the document. |
|
76 | - * |
|
77 | - * @param int $depth |
|
78 | - * @return XMLHelper_Converter_Decorator |
|
79 | - */ |
|
74 | + /** |
|
75 | + * Set the maximum depth to parse in the document. |
|
76 | + * |
|
77 | + * @param int $depth |
|
78 | + * @return XMLHelper_Converter_Decorator |
|
79 | + */ |
|
80 | 80 | public function setDepth(int $depth) : XMLHelper_Converter_Decorator |
81 | 81 | { |
82 | 82 | $this->options['depth'] = (int)max(0, $depth); |