@@ -113,7 +113,7 @@ private function getValidTypes(string $content): string
113113 preg_match ('{^ ' .SniffHelper::REGEX_TYPES .'$}ix ' , $ content , $ matches );
114114
115115 if (isset ($ matches ['array ' ]) && '' !== $ matches ['array ' ]) {
116- $ validType = $ this ->getValidTypes (substr ($ matches ['array ' ], 0 , -2 )).'[] ' ;
116+ $ validType = $ this ->getValidTypes (mb_substr ($ matches ['array ' ], 0 , -2 )).'[] ' ;
117117 } elseif (isset ($ matches ['multiple ' ]) && '' !== $ matches ['multiple ' ]) {
118118 $ validType = '( ' .$ this ->getValidTypes ($ matches ['mutipleContent ' ]).') ' ;
119119 } elseif (isset ($ matches ['generic ' ]) && '' !== $ matches ['generic ' ]) {
@@ -126,8 +126,8 @@ private function getValidTypes(string $content): string
126126
127127 $ types [] = $ validType ;
128128
129- $ separators [] = substr ($ content , strlen ($ matches ['type ' ]), 1 );
130- $ content = substr ($ content , strlen ($ matches ['type ' ]) + 1 );
129+ $ separators [] = mb_substr ($ content , mb_strlen ($ matches ['type ' ]), 1 );
130+ $ content = mb_substr ($ content , mb_strlen ($ matches ['type ' ]) + 1 );
131131 }
132132
133133 // Remove last separator since it's an empty string
@@ -185,7 +185,7 @@ private function getValidGenericType(string $genericName, string $genericContent
185185 preg_match ('{^ ' .SniffHelper::REGEX_TYPES .',?}ix ' , $ genericContent , $ matches );
186186
187187 $ validType .= $ this ->getValidTypes ($ matches ['types ' ]).', ' ;
188- $ genericContent = substr ($ genericContent , strlen ($ matches ['types ' ]) + 1 );
188+ $ genericContent = mb_substr ($ genericContent , mb_strlen ($ matches ['types ' ]) + 1 );
189189 }
190190
191191 return preg_replace ('/,\s$/ ' , '> ' , $ validType );
@@ -213,7 +213,7 @@ private function getValidObjectType(string $objectContent): string
213213 preg_match ('{^ ' .SniffHelper::REGEX_TYPES .',?}ix ' , $ objectContent , $ matches );
214214
215215 $ validType .= $ this ->getValidTypes ($ matches ['types ' ]).', ' ;
216- $ objectContent = substr ($ objectContent , strlen ($ matches ['types ' ]) + 1 );
216+ $ objectContent = mb_substr ($ objectContent , mb_strlen ($ matches ['types ' ]) + 1 );
217217 }
218218
219219 return preg_replace ('/,\s$/ ' , '} ' , $ validType );
@@ -226,7 +226,7 @@ private function getValidObjectType(string $objectContent): string
226226 */
227227 private function getValidType (string $ typeName ): string
228228 {
229- $ lowerType = strtolower ($ typeName );
229+ $ lowerType = mb_strtolower ($ typeName );
230230 if (isset (self ::TYPES [$ lowerType ])) {
231231 return self ::TYPES [$ lowerType ] ? $ lowerType : $ typeName ;
232232 }
0 commit comments