| 1 | <?php |
||
| 20 | final class ClassNamesWithoutPreSlashSniff implements PHP_CodeSniffer_Sniff |
||
| 21 | { |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | const NAME = 'ZenifyCodingStandard.Namespaces.ClassNamesWithoutPreSlash'; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var string[] |
||
| 30 | */ |
||
| 31 | private $excludedClassNames = [ |
||
| 32 | 'DateTime', 'stdClass', 'splFileInfo', 'Exception' |
||
| 33 | ]; |
||
| 34 | |||
| 35 | |||
| 36 | /** |
||
| 37 | * @return int[] |
||
| 38 | */ |
||
| 39 | 1 | public function register() : array |
|
| 43 | |||
| 44 | |||
| 45 | /** |
||
| 46 | * @param PHP_CodeSniffer_File $file |
||
| 47 | * @param int $position |
||
| 48 | */ |
||
| 49 | 1 | public function process(PHP_CodeSniffer_File $file, $position) |
|
| 61 | |||
| 62 | |||
| 63 | /** |
||
| 64 | * @param string $className |
||
| 65 | * @return bool |
||
| 66 | */ |
||
| 67 | 1 | private function isExcludedClassName($className) |
|
| 74 | |||
| 75 | } |
||
| 76 |