Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ReflectionClassUsedSniff implements PHP_CodeSniffer_Sniff
- {
- public function register()
- {
- return array(T_STRING);
- }
- public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
- {
- $tokens = $phpcsFile->getTokens();
- $token = $tokens[$stackPtr];
- if(strncmp($token['content'], 'Reflection', 10) === 0) {
- $phpcsFile->addError('Usage of the Reflection API is not allowed', $stackPtr, 'Found');
- }
- }
- }
Add Comment
Please, Sign In to add comment