File tree 2 files changed +37
-0
lines changed
2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace SymfonyCustom \Sniffs \PHP ;
6
+
7
+ use PHP_CodeSniffer \Standards \Generic \Sniffs \PHP \ForbiddenFunctionsSniff ;
8
+
9
+ /**
10
+ * Class DiscourageNonMultiBytesSniff
11
+ */
12
+ class DiscourageNonMultiBytesSniff extends ForbiddenFunctionsSniff
13
+ {
14
+ /**
15
+ * @var array
16
+ */
17
+ public $ forbiddenFunctions = [
18
+ 'chr ' => 'mb_chr ' ,
19
+ 'split ' => 'mb_split ' ,
20
+ 'str_split ' => 'mb_str_split ' ,
21
+ 'stripos ' => 'mb_stripos ' ,
22
+ 'stristr ' => 'mb_stristr ' ,
23
+ 'strlen ' => 'mb_strlen ' ,
24
+ 'strrchr ' => 'mb_strrchr ' ,
25
+ 'strripos ' => 'mb_strripos ' ,
26
+ 'strrpos ' => 'mb_strrpos ' ,
27
+ 'strtolower ' => 'mb_strtolower ' ,
28
+ 'substr_count ' => 'mb_substr_count ' ,
29
+ 'substr ' => 'mb_substr ' ,
30
+ ];
31
+
32
+ /**
33
+ * @var bool
34
+ */
35
+ public $ error = false ;
36
+ }
Original file line number Diff line number Diff line change 18
18
"bin" : [" bin/twigcs" ],
19
19
"require" : {
20
20
"php" : " >=7.2" ,
21
+ "ext-mbstring" : " *" ,
21
22
"squizlabs/php_codesniffer" : " ^3.5" ,
22
23
"symfony/console" : " ^4.4 || ^5.0" ,
23
24
"symfony/twig-bridge" : " ^4.4 || ^5.0" ,
You can’t perform that action at this time.
0 commit comments