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

PHPCSStandards / PHP_CodeSniffer / 18079229190

19 Sep 2025 11:00PM UTC coverage: 78.601% (-0.6%) from 79.178%
18079229190

push

github

jrfnl
Dependabot: remove `cooldown`

Follow up on PR 1273

Turns out that the `cooldown` configuration option is not supported for the `github-actions` ecosystem.... _sigh_

So I guess I better remove it again as otherwise Dependabot is blocked from running due to this "configuration error".

25341 of 32240 relevant lines covered (78.6%)

74.7 hits per line

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

73.91
/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php
1
<?php
2
/**
3
 * Ensure that each style definition is on a line by itself.
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/HEAD/licence.txt BSD Licence
8
 *
9
 * @deprecated 3.9.0
10
 */
11

12
namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS;
13

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

18
class DisallowMultipleStyleDefinitionsSniff implements Sniff, DeprecatedSniff
19
{
20

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

28

29
    /**
30
     * Returns the token types that this sniff is interested in.
31
     *
32
     * @return array<int|string>
33
     */
34
    public function register()
3✔
35
    {
36
        return [T_STYLE];
3✔
37

38
    }//end register()
39

40

41
    /**
42
     * Processes the tokens that this sniff is interested in.
43
     *
44
     * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found.
45
     * @param int                         $stackPtr  The position in the stack where
46
     *                                               the token was found.
47
     *
48
     * @return void
49
     */
50
    public function process(File $phpcsFile, $stackPtr)
3✔
51
    {
52
        $tokens = $phpcsFile->getTokens();
3✔
53
        $next   = $phpcsFile->findNext(T_STYLE, ($stackPtr + 1));
3✔
54
        if ($next === false) {
3✔
55
            return;
3✔
56
        }
57

58
        if ($tokens[$next]['content'] === 'progid') {
3✔
59
            // Special case for IE filters.
60
            return;
3✔
61
        }
62

63
        if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) {
3✔
64
            $error = 'Each style definition must be on a line by itself';
3✔
65
            $fix   = $phpcsFile->addFixableError($error, $next, 'Found');
3✔
66
            if ($fix === true) {
3✔
67
                $phpcsFile->fixer->addNewlineBefore($next);
3✔
68
            }
1✔
69
        }
1✔
70

71
    }//end process()
2✔
72

73

74
    /**
75
     * Provide the version number in which the sniff was deprecated.
76
     *
77
     * @return string
78
     */
79
    public function getDeprecationVersion()
×
80
    {
81
        return 'v3.9.0';
×
82

83
    }//end getDeprecationVersion()
84

85

86
    /**
87
     * Provide the version number in which the sniff will be removed.
88
     *
89
     * @return string
90
     */
91
    public function getRemovalVersion()
×
92
    {
93
        return 'v4.0.0';
×
94

95
    }//end getRemovalVersion()
96

97

98
    /**
99
     * Provide a custom message to display with the deprecation.
100
     *
101
     * @return string
102
     */
103
    public function getDeprecationMessage()
×
104
    {
105
        return 'Support for scanning CSS files will be removed completely in v4.0.0.';
×
106

107
    }//end getDeprecationMessage()
108

109

110
}//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