Conditions | 3 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
29 | { |
||
30 | if ($this->supportsAbove('7.2') === false) { |
||
31 | return; |
||
32 | } |
||
33 | |||
34 | $tokens = $phpcsFile->getTokens(); |
||
35 | |||
36 | $function = $tokens[$stackPtr]; |
||
37 | var_dump($function) . "\n"; |
||
38 | $funcName = $phpcsFile->getDeclarationName($stackPtr); |
||
39 | die('wtf'); |
||
40 | echo $funcName . "\n"; |
||
41 | |||
42 | if (strtolower($funcName) !== '__autoload') { |
||
43 | return; |
||
44 | } |
||
45 | |||
46 | $phpcsFile->addWarning( |
||
47 | 'Use of __autoload() function is deprecated since PHP 7.2', |
||
48 | $stackPtr, |
||
49 | 'Found' |
||
50 | ); |
||
51 | } |
||
52 | } |
||
53 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.