Passed
Push — master ( 6080f3...d98100 )
by Sebastian
03:12
created
src/ConvertHelper/ControlCharacters.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 {
23 23
     public const ERROR_MALFORMATTED_STRING = 53801;
24 24
     
25
-   /**
26
-    * @var string[]
27
-    */
25
+    /**
26
+     * @var string[]
27
+     */
28 28
     protected static $controlChars =  array(
29 29
         '0000-0008', // control chars
30 30
         '000E-000F', // control chars
@@ -32,19 +32,19 @@  discard block
 block discarded – undo
32 32
         '2000-200F', // non-breaking space and co
33 33
     );
34 34
     
35
-   /**
36
-    * @var string|NULL
37
-    */
35
+    /**
36
+     * @var string|NULL
37
+     */
38 38
     protected static $controlCharsRegex;
39 39
 
40
-   /**
41
-    * @var string[]
42
-    */
40
+    /**
41
+     * @var string[]
42
+     */
43 43
     protected static $hexAlphabet = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
44 44
     
45
-   /**
46
-    * @var string[]|NULL
47
-    */
45
+    /**
46
+     * @var string[]|NULL
47
+     */
48 48
     protected static $charsAsHex;
49 49
     
50 50
     public function __construct()
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
         }
68 68
     }
69 69
     
70
-   /**
71
-    * Retrieves the HEX character codes for all control
72
-    * characters that the {@link stripControlCharacters()}
73
-    * method will remove.
74
-    *
75
-    * @return string[]
76
-    */
70
+    /**
71
+     * Retrieves the HEX character codes for all control
72
+     * characters that the {@link stripControlCharacters()}
73
+     * method will remove.
74
+     *
75
+     * @return string[]
76
+     */
77 77
     public function getCharsAsHex() : array
78 78
     {
79 79
         if (isset(self::$charsAsHex))
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
         return $stack;
121 121
     }
122 122
     
123
-   /**
124
-    * Retrieves an array of all control characters that
125
-    * the {@link stripControlCharacters()} method will
126
-    * remove, as the actual UTF-8 characters.
127
-    *
128
-    * @return string[]
129
-    */
123
+    /**
124
+     * Retrieves an array of all control characters that
125
+     * the {@link stripControlCharacters()} method will
126
+     * remove, as the actual UTF-8 characters.
127
+     *
128
+     * @return string[]
129
+     */
130 130
     public function getCharsAsUTF8() : array
131 131
     {
132 132
         $chars = $this->getCharsAsHex();
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
         return $result;
140 140
     }
141 141
     
142
-   /**
143
-    * Retrieves all control characters as JSON encoded
144
-    * characters, e.g. "\u200b".
145
-    *
146
-    * @return string[]
147
-    */
142
+    /**
143
+     * Retrieves all control characters as JSON encoded
144
+     * characters, e.g. "\u200b".
145
+     *
146
+     * @return string[]
147
+     */
148 148
     public function getCharsAsJSON() : array
149 149
     {
150 150
         $chars = $this->getCharsAsHex();
@@ -157,17 +157,17 @@  discard block
 block discarded – undo
157 157
         return $result;
158 158
     }
159 159
     
160
-   /**
161
-    * Removes all control characters from the specified string
162
-    * that can cause problems in some cases, like creating
163
-    * valid XML documents. This includes invisible non-breaking
164
-    * spaces.
165
-    *
166
-    * @param string $string
167
-    * @return string
168
-    * @see https://stackoverflow.com/a/8171868/2298192
169
-    * @see https://unicode-table.com/en
170
-    */
160
+    /**
161
+     * Removes all control characters from the specified string
162
+     * that can cause problems in some cases, like creating
163
+     * valid XML documents. This includes invisible non-breaking
164
+     * spaces.
165
+     *
166
+     * @param string $string
167
+     * @return string
168
+     * @see https://stackoverflow.com/a/8171868/2298192
169
+     * @see https://unicode-table.com/en
170
+     */
171 171
     public function stripControlCharacters(string $string) : string
172 172
     {
173 173
         if(empty($string)) 
Please login to merge, or discard this patch.
src/XMLHelper/Converter.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 {
47 47
     public const ERROR_FAILED_CONVERTING_TO_JSON = 37901;
48 48
     
49
-   /**
50
-    * @var SimpleXMLElement
51
-    */
49
+    /**
50
+     * @var SimpleXMLElement
51
+     */
52 52
     protected $xml;
53 53
     
54
-   /**
55
-    * @var string|NULL
56
-    */
54
+    /**
55
+     * @var string|NULL
56
+     */
57 57
     protected $json;
58 58
     
59 59
     protected function __construct(SimpleXMLElement $element)
@@ -86,34 +86,34 @@  discard block
 block discarded – undo
86 86
         return self::fromElement(new SimpleXMLElement($xmlString));
87 87
     }
88 88
     
89
-   /**
90
-    * Factory method: creates a converter from an existing SimpleXMLElement instance.
91
-    * 
92
-    * @param SimpleXMLElement $element
93
-    * @return XMLHelper_Converter
94
-    */
89
+    /**
90
+     * Factory method: creates a converter from an existing SimpleXMLElement instance.
91
+     * 
92
+     * @param SimpleXMLElement $element
93
+     * @return XMLHelper_Converter
94
+     */
95 95
     public static function fromElement(SimpleXMLElement $element) : XMLHelper_Converter
96 96
     {
97 97
         return new XMLHelper_Converter($element);
98 98
     }
99 99
 
100
-   /**
101
-    * Factory method: creates a converter from an existing SimpleXMLElement instance.
102
-    *
103
-    * @param DOMElement $element
104
-    * @return XMLHelper_Converter
105
-    */
100
+    /**
101
+     * Factory method: creates a converter from an existing SimpleXMLElement instance.
102
+     *
103
+     * @param DOMElement $element
104
+     * @return XMLHelper_Converter
105
+     */
106 106
     public static function fromDOMElement(DOMElement $element) : XMLHelper_Converter
107 107
     {
108 108
         return new XMLHelper_Converter(simplexml_import_dom($element));
109 109
     }
110 110
     
111
-   /**
112
-    * Converts the XML to JSON.
113
-    * 
114
-    * @return string
115
-    * @throws XMLHelper_Exception|JsonException
116
-    */
111
+    /**
112
+     * Converts the XML to JSON.
113
+     * 
114
+     * @return string
115
+     * @throws XMLHelper_Exception|JsonException
116
+     */
117 117
     public function toJSON() : string
118 118
     {
119 119
         if (isset($this->json))
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
         }
147 147
     }
148 148
 
149
-   /**
150
-    * Converts the XML to an associative array.
151
-    * @return array
152
-    * @throws XMLHelper_Exception|JsonException
153
-    */
149
+    /**
150
+     * Converts the XML to an associative array.
151
+     * @return array
152
+     * @throws XMLHelper_Exception|JsonException
153
+     */
154 154
     public function toArray() : array 
155 155
     {
156 156
         $json = $this->toJSON();
Please login to merge, or discard this patch.
src/XMLHelper/DOMErrors.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
 {
24 24
     public const SERIALIZE_SEPARATOR = '__SERSEP__';
25 25
     
26
-   /**
27
-    * @var XMLHelper_DOMErrors_Error[]
28
-    */
26
+    /**
27
+     * @var XMLHelper_DOMErrors_Error[]
28
+     */
29 29
     private $errors;
30 30
     
31
-   /**
32
-    * @param \LibXMLError[]|XMLHelper_DOMErrors_Error[] $libxmlErrors
33
-    */
31
+    /**
32
+     * @param \LibXMLError[]|XMLHelper_DOMErrors_Error[] $libxmlErrors
33
+     */
34 34
     public function __construct(array $libxmlErrors)
35 35
     {
36 36
         foreach($libxmlErrors as $error)
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
         return $this->errors;
57 57
     }
58 58
     
59
-   /**
60
-    * Retrieves all warnings, if any.
61
-    * 
62
-    * @return XMLHelper_DOMErrors_Error[]
63
-    */
59
+    /**
60
+     * Retrieves all warnings, if any.
61
+     * 
62
+     * @return XMLHelper_DOMErrors_Error[]
63
+     */
64 64
     public function getWarnings()
65 65
     {
66 66
         return $this->getByLevel(LIBXML_ERR_WARNING);
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
     }
108 108
     
109 109
     
110
-   /**
111
-    * Retrieves all errors by the specified libxml error level.
112
-    * 
113
-    * @param int $level
114
-    * @return \AppUtils\XMLHelper_DOMErrors_Error[]
115
-    */
110
+    /**
111
+     * Retrieves all errors by the specified libxml error level.
112
+     * 
113
+     * @param int $level
114
+     * @return \AppUtils\XMLHelper_DOMErrors_Error[]
115
+     */
116 116
     public function getByLevel(int $level)
117 117
     {
118 118
         $result = array();
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
128 128
         return $result;
129 129
     }
130 130
     
131
-   /**
132
-    * Retrieves all errors by the specified libxml error code.
133
-    * 
134
-    * @param int $code
135
-    * @return \AppUtils\XMLHelper_DOMErrors_Error[]
136
-    */
131
+    /**
132
+     * Retrieves all errors by the specified libxml error code.
133
+     * 
134
+     * @param int $code
135
+     * @return \AppUtils\XMLHelper_DOMErrors_Error[]
136
+     */
137 137
     public function getByCode(int $code)
138 138
     {
139 139
         $result = array();
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
         return $result;
150 150
     }
151 151
     
152
-   /**
153
-    * Checks whether there are errors matching the libxml error level.
154
-    * 
155
-    * @param int $level
156
-    * @return bool
157
-    */
152
+    /**
153
+     * Checks whether there are errors matching the libxml error level.
154
+     * 
155
+     * @param int $level
156
+     * @return bool
157
+     */
158 158
     public function hasErrorsByLevel(int $level) : bool
159 159
     {
160 160
         foreach($this->errors as $error)
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
         return false;
169 169
     }
170 170
     
171
-   /**
172
-    * Checks whether there are any errors matching the libxml error code.
173
-    * 
174
-    * @param int $code
175
-    * @return bool
176
-    */
171
+    /**
172
+     * Checks whether there are any errors matching the libxml error code.
173
+     * 
174
+     * @param int $code
175
+     * @return bool
176
+     */
177 177
     public function hasErrorsByCode(int $code) : bool
178 178
     {
179 179
         foreach($this->errors as $error)
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
         return $result;
200 200
     }
201 201
     
202
-   /**
203
-    * Serializes the errors collection, so it can be stored and
204
-    * restored as needed, using the `fromSerialized()` method.
205
-    * 
206
-    * @return string
207
-    * @see XMLHelper_DOMErrors::fromSerialized()
208
-    */
202
+    /**
203
+     * Serializes the errors collection, so it can be stored and
204
+     * restored as needed, using the `fromSerialized()` method.
205
+     * 
206
+     * @return string
207
+     * @see XMLHelper_DOMErrors::fromSerialized()
208
+     */
209 209
     public function serialize() : string
210 210
     {
211 211
         $data = array();
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
         return implode(self::SERIALIZE_SEPARATOR, $data);
219 219
     }
220 220
     
221
-   /**
222
-    * Restores the errors collection from a previously serialized
223
-    * collection, using `serialize()`. 
224
-    * 
225
-    * @param string $serialized
226
-    * @return XMLHelper_DOMErrors
227
-    * @see XMLHelper_DOMErrors::serialize()
228
-    */
221
+    /**
222
+     * Restores the errors collection from a previously serialized
223
+     * collection, using `serialize()`. 
224
+     * 
225
+     * @param string $serialized
226
+     * @return XMLHelper_DOMErrors
227
+     * @see XMLHelper_DOMErrors::serialize()
228
+     */
229 229
     public static function fromSerialized(string $serialized) : XMLHelper_DOMErrors
230 230
     {
231 231
         $parts = explode(self::SERIALIZE_SEPARATOR, $serialized);
Please login to merge, or discard this patch.
src/XMLHelper/DOMErrors/Error.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@
 block discarded – undo
24 24
     public const ERROR_CANNOT_UNSERIALIZE_ERROR_DATA = 57201;
25 25
     public const ERROR_ERROR_DATA_KEY_MISSING = 57202;
26 26
     
27
-   /**
28
-    * @var \LibXMLError
29
-    */
27
+    /**
28
+     * @var \LibXMLError
29
+     */
30 30
     private $error;
31 31
     
32 32
     private static $requiredKeys = array(
Please login to merge, or discard this patch.
src/XMLHelper/HTMLLoader.php 1 patch
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
 {
37 37
     public const ERROR_STRING_ALREADY_HAS_BODY_TAG = 57001;
38 38
     
39
-   /**
40
-    * @var \DOMElement
41
-    */
39
+    /**
40
+     * @var \DOMElement
41
+     */
42 42
     private $bodyNode;
43 43
     
44
-   /**
45
-    * @var XMLHelper_DOMErrors
46
-    */
44
+    /**
45
+     * @var XMLHelper_DOMErrors
46
+     */
47 47
     private $errors;
48 48
     
49
-   /**
50
-    * @var string
51
-    */
49
+    /**
50
+     * @var string
51
+     */
52 52
     private static $htmlTemplate = 
53 53
     '<!DOCTYPE html>'.
54 54
     '<html>'.
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
         '</body>'.
61 61
     '</html>';
62 62
     
63
-   /**
64
-    * @var \DOMDocument
65
-    */
63
+    /**
64
+     * @var \DOMDocument
65
+     */
66 66
     private $dom;
67 67
 
68 68
     private function __construct(string $html)
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
         $this->load($html);
71 71
     }
72 72
     
73
-   /**
74
-    * Creates an HTML loader from an HTML fragment (without
75
-    * doctype, head and body elements).
76
-    * 
77
-    * @param string $fragment
78
-    * @return XMLHelper_HTMLLoader
79
-    */
73
+    /**
74
+     * Creates an HTML loader from an HTML fragment (without
75
+     * doctype, head and body elements).
76
+     * 
77
+     * @param string $fragment
78
+     * @return XMLHelper_HTMLLoader
79
+     */
80 80
     public static function loadFragment(string $fragment) : XMLHelper_HTMLLoader
81 81
     {
82 82
         self::checkFragment($fragment);
@@ -87,24 +87,24 @@  discard block
 block discarded – undo
87 87
         return new XMLHelper_HTMLLoader($pseudoHTML);
88 88
     }
89 89
     
90
-   /**
91
-    * Creates an HTML loader from a full HTML document (including
92
-    * doctype, head and body elements).
93
-    * 
94
-    * @param string $html
95
-    * @return XMLHelper_HTMLLoader
96
-    */
90
+    /**
91
+     * Creates an HTML loader from a full HTML document (including
92
+     * doctype, head and body elements).
93
+     * 
94
+     * @param string $html
95
+     * @return XMLHelper_HTMLLoader
96
+     */
97 97
     public static function loadHTML(string $html) : XMLHelper_HTMLLoader
98 98
     {
99 99
         return  new XMLHelper_HTMLLoader($html);
100 100
     }
101 101
 
102
-   /**
103
-    * Verifies that the fragment does not already contain a body element or doctype.
104
-    * 
105
-    * @param string $fragment
106
-    * @throws XMLHelper_Exception
107
-    */
102
+    /**
103
+     * Verifies that the fragment does not already contain a body element or doctype.
104
+     * 
105
+     * @param string $fragment
106
+     * @throws XMLHelper_Exception
107
+     */
108 108
     private static function checkFragment(string $fragment) : void
109 109
     {
110 110
         if(!stristr($fragment, '<body') && !stristr($fragment, 'doctype'))
@@ -142,65 +142,65 @@  discard block
 block discarded – undo
142 142
         return $this->bodyNode;
143 143
     }
144 144
     
145
-   /**
146
-    * Retrieves the document's `<body>` tag node.
147
-    * 
148
-    * @return \DOMDocument
149
-    */
145
+    /**
146
+     * Retrieves the document's `<body>` tag node.
147
+     * 
148
+     * @return \DOMDocument
149
+     */
150 150
     public function getDOM() : \DOMDocument
151 151
     {
152 152
         return $this->dom;
153 153
     }
154 154
     
155
-   /**
156
-    * Retrieves all nodes from the HTML fragment (= child nodes
157
-    * of the `<body>` element).
158
-    * 
159
-    * @return \DOMNodeList
160
-    */
155
+    /**
156
+     * Retrieves all nodes from the HTML fragment (= child nodes
157
+     * of the `<body>` element).
158
+     * 
159
+     * @return \DOMNodeList
160
+     */
161 161
     public function getFragmentNodes() : \DOMNodeList
162 162
     {
163 163
         return $this->bodyNode->childNodes;
164 164
     }
165 165
     
166
-   /**
167
-    * Retrieves the LibXML HTML parsing errors collection, which
168
-    * can be used to review any errors that occurred while loading
169
-    * the HTML document.
170
-    * 
171
-    * @return XMLHelper_DOMErrors
172
-    */
166
+    /**
167
+     * Retrieves the LibXML HTML parsing errors collection, which
168
+     * can be used to review any errors that occurred while loading
169
+     * the HTML document.
170
+     * 
171
+     * @return XMLHelper_DOMErrors
172
+     */
173 173
     public function getErrors() : XMLHelper_DOMErrors
174 174
     {
175 175
         return $this->errors;
176 176
     }
177 177
     
178
-   /**
179
-    * Returns a valid HTML string.
180
-    * 
181
-    * @return string
182
-    */
178
+    /**
179
+     * Returns a valid HTML string.
180
+     * 
181
+     * @return string
182
+     */
183 183
     public function toHTML() : string
184 184
     {
185 185
         return $this->dom->saveHTML();
186 186
     }
187 187
     
188
-   /**
189
-    * Returns a valid XML string.
190
-    * 
191
-    * @return string
192
-    */
188
+    /**
189
+     * Returns a valid XML string.
190
+     * 
191
+     * @return string
192
+     */
193 193
     public function toXML() : string
194 194
     {
195 195
         return $this->dom->saveXML();
196 196
     }
197 197
     
198
-   /**
199
-    * Converts the HTML fragment to valid XML (= all
200
-    * child nodes of the `<body>` element).
201
-    * 
202
-    * @return string
203
-    */
198
+    /**
199
+     * Converts the HTML fragment to valid XML (= all
200
+     * child nodes of the `<body>` element).
201
+     * 
202
+     * @return string
203
+     */
204 204
     public function fragmentToXML() : string
205 205
     {
206 206
         $nodes = $this->getFragmentNodes();
Please login to merge, or discard this patch.
src/XMLHelper/SimpleXML.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -23,37 +23,37 @@
 block discarded – undo
23 23
 {
24 24
     public const ERROR_NOT_LOADED_YET = 56501;
25 25
     
26
-   /**
27
-    * @var \SimpleXMLElement|NULL
28
-    */
26
+    /**
27
+     * @var \SimpleXMLElement|NULL
28
+     */
29 29
     private $element = null;
30 30
     
31
-   /**
32
-    * @var XMLHelper_SimpleXML_Error[]
33
-    */
31
+    /**
32
+     * @var XMLHelper_SimpleXML_Error[]
33
+     */
34 34
     private $errors = array();
35 35
     
36
-   /**
37
-    * Creates a simplexml instance from an XML string.
38
-    *
39
-    * NOTE: returns false in case of a fatal error.
40
-    *
41
-    * @param string $string
42
-    * @return \SimpleXMLElement|NULL
43
-    */
36
+    /**
37
+     * Creates a simplexml instance from an XML string.
38
+     *
39
+     * NOTE: returns false in case of a fatal error.
40
+     *
41
+     * @param string $string
42
+     * @return \SimpleXMLElement|NULL
43
+     */
44 44
     public function loadString(string $string) : ?\SimpleXMLElement
45 45
     {
46 46
         return $this->load('string', $string);
47 47
     }
48 48
     
49
-   /**
50
-    * Creates a simplexml instance from an XML file.
51
-    * 
52
-    * NOTE: returns false in case of a fatal error.
53
-    * 
54
-    * @param string $file
55
-    * @return \SimpleXMLElement|NULL
56
-    */
49
+    /**
50
+     * Creates a simplexml instance from an XML file.
51
+     * 
52
+     * NOTE: returns false in case of a fatal error.
53
+     * 
54
+     * @param string $file
55
+     * @return \SimpleXMLElement|NULL
56
+     */
57 57
     public function loadFile(string $file) : ?\SimpleXMLElement
58 58
     {
59 59
         return $this->load('file', $file);
Please login to merge, or discard this patch.
src/XMLHelper/Converter/Decorator.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -21,25 +21,25 @@  discard block
 block discarded – undo
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
     public 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|string|null
42
-    */
40
+    /**
41
+     * @var array|string|null
42
+     */
43 43
     protected $result = array();
44 44
     
45 45
     public function __construct(\SimpleXMLElement $element)
@@ -47,36 +47,36 @@  discard block
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/RegexHelper.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
     
43 43
     public const REGEX_MD5 = '/^[a-f0-9]{32}$/i';
44 44
 
45
-   /**
46
-    * @var string
47
-    * @see https://en.wikipedia.org/wiki/Email_address#Local-part
48
-    */
45
+    /**
46
+     * @var string
47
+     * @see https://en.wikipedia.org/wiki/Email_address#Local-part
48
+     */
49 49
     public const REGEX_EMAIL = '/[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i';
50 50
     
51 51
     public const REGEX_PHONE = '/\A[+0-9][0-9 +\-()]+\z/m';
@@ -97,14 +97,14 @@  discard block
 block discarded – undo
97 97
      */
98 98
     public const REGEX_IS_HTML = '%<{0,1}[a-z\/][\s\S]*>|<[a-z\/][\s\S]*>{0,1}%i';
99 99
     
100
-   /**
101
-    * Hexadecimal color codes. Allows the following formats:
102
-    * 
103
-    * FFFFFF
104
-    * FFF
105
-    * 
106
-    * @var string
107
-    */
100
+    /**
101
+     * Hexadecimal color codes. Allows the following formats:
102
+     * 
103
+     * FFFFFF
104
+     * FFF
105
+     * 
106
+     * @var string
107
+     */
108 108
     public const REGEX_HEX_COLOR_CODE = '/\A(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{3})\z/iU';
109 109
 
110 110
     /**
Please login to merge, or discard this patch.
src/VariableInfo.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -37,19 +37,19 @@  discard block
 block discarded – undo
37 37
 
38 38
     public const ERROR_INVALID_SERIALIZED_DATA = 56301;
39 39
     
40
-   /**
41
-    * @var string
42
-    */
40
+    /**
41
+     * @var string
42
+     */
43 43
     protected $string;
44 44
     
45
-   /**
46
-    * @var mixed
47
-    */
45
+    /**
46
+     * @var mixed
47
+     */
48 48
     protected $value;
49 49
     
50
-   /**
51
-    * @var string
52
-    */
50
+    /**
51
+     * @var string
52
+     */
53 53
     protected $type;
54 54
 
55 55
     /**
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
         return new VariableInfo(null, $serialized);
107 107
     }
108 108
     
109
-   /**
110
-    * Parses a previously serialized data set to restore the 
111
-    * variable information from it.
112
-    * 
113
-    * @param array $serialized
114
-    * @throws BaseException
115
-    * 
116
-    * @see VariableInfo::ERROR_INVALID_SERIALIZED_DATA
117
-    */
109
+    /**
110
+     * Parses a previously serialized data set to restore the 
111
+     * variable information from it.
112
+     * 
113
+     * @param array $serialized
114
+     * @throws BaseException
115
+     * 
116
+     * @see VariableInfo::ERROR_INVALID_SERIALIZED_DATA
117
+     */
118 118
     protected function parseSerialized(array $serialized) : void
119 119
     {
120 120
         if(!isset($serialized['string']) || !isset($serialized['type']) || !isset($serialized['options']))
@@ -156,12 +156,12 @@  discard block
 block discarded – undo
156 156
         return $this->value;
157 157
     }
158 158
     
159
-   /**
160
-    * The variable type - this is the same string that
161
-    * is returned by the PHP function `gettype`.
162
-    * 
163
-    * @return string
164
-    */
159
+    /**
160
+     * The variable type - this is the same string that
161
+     * is returned by the PHP function `gettype`.
162
+     * 
163
+     * @return string
164
+     */
165 165
     public function getType() : string
166 166
     {
167 167
         return $this->type;
@@ -175,13 +175,13 @@  discard block
 block discarded – undo
175 175
         );
176 176
     }
177 177
     
178
-   /**
179
-    * Whether to prepend the variable type before the value, 
180
-    * like the var_dump function. Example: <code>string "Some text"</code>.
181
-    * 
182
-    * @param bool $enable
183
-    * @return VariableInfo
184
-    */
178
+    /**
179
+     * Whether to prepend the variable type before the value, 
180
+     * like the var_dump function. Example: <code>string "Some text"</code>.
181
+     * 
182
+     * @param bool $enable
183
+     * @return VariableInfo
184
+     */
185 185
     public function enableType(bool $enable=true) : VariableInfo
186 186
     {
187 187
         return $this->setOption('prepend-type', $enable);
Please login to merge, or discard this patch.