@@ -111,6 +111,7 @@ public function __construct($url = null)
111111 if ($ this ->unaChecked !== false ) {
112112 $ this ->resetUNA ();
113113 }
114+
114115 if ($ this ->unbChecked !== false ) {
115116 $ this ->resetUNB ();
116117 }
@@ -122,25 +123,25 @@ public function __construct($url = null)
122123 return ;
123124 }
124125 if (\is_array ($ url )) {
125- /**
126- * Object constructed with an array as argument
127- * /
126+ //
127+ // Object constructed with an array as argument
128+ / /
128129 if (\count ($ url ) == 1 ) {
129130 $ url = $ this ->unwrap ($ url [0 ]);
130131 }
131132 $ this ->rawSegments = $ url ;
132133 /** @noinspection UnusedFunctionResultInspection */
133134 $ this ->parse ($ url );
134135 } elseif (file_exists ($ url )) {
135- /**
136- * Object constructed with a path to a file as argument
137- * /
136+ //
137+ // Object constructed with a path to a file as argument
138+ / /
138139 /** @noinspection UnusedFunctionResultInspection */
139140 $ this ->load ($ url );
140141 } else {
141- /**
142- * Object constructed with a string as argument
143- * /
142+ //
143+ // Object constructed with a string as argument
144+ / /
144145 /** @noinspection UnusedFunctionResultInspection */
145146 $ this ->loadString ($ url );
146147 }
@@ -159,17 +160,13 @@ public function parse(&$file2): array
159160 for ($ i = 1 ; $ i <= $ t ; $ i ++) {
160161 $ line = \array_shift ($ file2 );
161162
162- /**
163- * Null byte and carriage return removal (CR+LF)
164- */
163+ // Null byte and carriage return removal (CR+LF)
165164 $ line = \preg_replace ('#[\x00\r\n]# ' , '' , $ line );
166165 if (\preg_match ($ this ->stripChars , $ line )) {
167166 $ this ->errors [] = "There's a not printable character on line " . $ i . ": " . $ line ;
168167 }
169168
170- /**
171- * Basic sanitization, remove non printable chars
172- */
169+ // Basic sanitization, remove non printable chars
173170 $ line = \preg_replace ($ this ->stripChars , '' , \trim ($ line ));
174171 if (\strlen ($ line ) < 2 ) {
175172 continue ;
@@ -316,11 +313,12 @@ public function analyseUNH($line)
316313 *
317314 * @return string[]
318315 */
319- private function unwrap ($ string ): array
316+ private function unwrap (& $ string ): array
320317 {
321318 if (!$ this ->unaChecked && \strpos ($ string , "UNA " ) === 0 ) {
322319 $ this ->analyseUNA (\preg_replace ("#^UNA# " , "" , substr ($ string , 0 , 9 )));
323320 }
321+
324322 if (!$ this ->unbChecked && \strpos ($ string , "UNB " ) === 0 ) {
325323 $ this ->analyseUNB (\preg_replace ("#^UNB\+# " , "" , substr ($ string , 0 , 8 )));
326324 }
@@ -350,7 +348,7 @@ private function unwrap($string): array
350348 *
351349 * @return array[]|string[]
352350 */
353- private function splitSegment ($ str ): array
351+ private function splitSegment (& $ str ): array
354352 {
355353 // remove ending symbEnd
356354 $ str = \trim (
@@ -405,7 +403,7 @@ private function splitSegment($str): array
405403 *
406404 * @return mixed
407405 */
408- private function splitData($ str)
406+ private function splitData(& $ str )
409407 {
410408 $ replace = function ($ string ) {
411409 $ regex = self ::$ DELIMITER . $ this ->symbRel . "(?= " . $ this ->symbRel . ")| " . $ this ->symbRel . "(?= " . $ this ->sepData . ")| " . $ this ->symbRel . "(?= " . $ this ->sepComp . ")| " . $ this ->symbRel . "(?= " . $ this ->symbEnd . ") " . self ::$ DELIMITER ;
0 commit comments