30
30
31
31
use Lmc \CodingStandard \Helper \Naming ;
32
32
use Lmc \CodingStandard \Helper \SniffClassWrapper ;
33
- use Nette \Utils \Strings ;
34
33
use PHP_CodeSniffer \Files \File ;
35
34
use PHP_CodeSniffer \Sniffs \Sniff ;
36
35
@@ -101,7 +100,7 @@ private function processType(File $file, string $currentParentType, string $clas
101
100
102
101
// the class that implements $currentParentType, should end with $suffix
103
102
$ suffix = $ this ->resolveExpectedSuffix ($ parentType );
104
- if (Strings:: endsWith ($ className , $ suffix )) {
103
+ if (str_ends_with ($ className , $ suffix )) {
105
104
continue ;
106
105
}
107
106
@@ -123,12 +122,12 @@ private function getClassToSuffixMap(): array
123
122
*/
124
123
private function resolveExpectedSuffix (string $ parentType ): string
125
124
{
126
- if (Strings:: endsWith ($ parentType , 'Interface ' )) {
127
- $ parentType = Strings:: substring ($ parentType , 0 , -mb_strlen ('Interface ' ));
125
+ if (str_ends_with ($ parentType , 'Interface ' )) {
126
+ $ parentType = mb_substr ($ parentType , 0 , -mb_strlen ('Interface ' ), ' UTF-8 ' );
128
127
}
129
128
130
- if (Strings:: startsWith ($ parentType , 'Abstract ' )) {
131
- $ parentType = Strings:: substring ($ parentType , mb_strlen ('Abstract ' ));
129
+ if (str_starts_with ($ parentType , 'Abstract ' )) {
130
+ $ parentType = mb_substr ($ parentType , mb_strlen ('Abstract ' ), null , ' UTF-8 ' );
132
131
}
133
132
134
133
return $ parentType ;
0 commit comments