• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PHPCSStandards / PHP_CodeSniffer / 17483947696

05 Sep 2025 04:45AM UTC coverage: 78.507% (-0.7%) from 79.184%
17483947696

push

github

web-flow
Merge pull request #1213 from PHPCSStandards/feature/remove-filelist-tests

:fire: Hot Fix: remove FileList tests

25309 of 32238 relevant lines covered (78.51%)

73.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.0
/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php
1
<?php
2
/**
3
 * Ensures that console is not used for function or var names.
4
 *
5
 * @author    Greg Sherwood <gsherwood@squiz.net>
6
 * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
7
 * @license   https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
8
 *
9
 * @deprecated 3.9.0
10
 */
11

12
namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Debug;
13

14
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
15
use PHP_CodeSniffer\Sniffs\Sniff;
16
use PHP_CodeSniffer\Files\File;
17

18
class FirebugConsoleSniff implements Sniff, DeprecatedSniff
19
{
20

21
    /**
22
     * A list of tokenizers this sniff supports.
23
     *
24
     * @var array
25
     */
26
    public $supportedTokenizers = ['JS'];
27

28

29
    /**
30
     * Returns an array of tokens this test wants to listen for.
31
     *
32
     * @return array<int|string>
33
     */
34
    public function register()
3✔
35
    {
36
        return [
1✔
37
            T_STRING,
3✔
38
            T_PROPERTY,
3✔
39
            T_LABEL,
3✔
40
            T_OBJECT,
3✔
41
        ];
2✔
42

43
    }//end register()
44

45

46
    /**
47
     * Processes this test, when one of its tokens is encountered.
48
     *
49
     * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
50
     * @param int                         $stackPtr  The position of the current token
51
     *                                               in the stack passed in $tokens.
52
     *
53
     * @return void
54
     */
55
    public function process(File $phpcsFile, $stackPtr)
3✔
56
    {
57
        $tokens = $phpcsFile->getTokens();
3✔
58

59
        if (strtolower($tokens[$stackPtr]['content']) === 'console') {
3✔
60
            $error = 'Variables, functions and labels must not be named "console"; name may conflict with Firebug internal variable';
3✔
61
            $phpcsFile->addError($error, $stackPtr, 'ConflictFound');
3✔
62
        }
1✔
63

64
    }//end process()
2✔
65

66

67
    /**
68
     * Provide the version number in which the sniff was deprecated.
69
     *
70
     * @return string
71
     */
72
    public function getDeprecationVersion()
×
73
    {
74
        return 'v3.9.0';
×
75

76
    }//end getDeprecationVersion()
77

78

79
    /**
80
     * Provide the version number in which the sniff will be removed.
81
     *
82
     * @return string
83
     */
84
    public function getRemovalVersion()
×
85
    {
86
        return 'v4.0.0';
×
87

88
    }//end getRemovalVersion()
89

90

91
    /**
92
     * Provide a custom message to display with the deprecation.
93
     *
94
     * @return string
95
     */
96
    public function getDeprecationMessage()
×
97
    {
98
        return 'The MySource standard will be removed completely in v4.0.0.';
×
99

100
    }//end getDeprecationMessage()
101

102

103
}//end class
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc