Skip to content

Commit 660de75

Browse files
gsherwoodjrfnl
andcommitted
Remove all JS/CSS specific code from mixed sniffs
Removes the JS/CSS support from the following sniffs: - Generic.Commenting.DocComment - Generic.Commenting.Fixme - Generic.Commenting.Todo - Generic.ControlStructures.InlineControlStructure - Generic.Files.EndFileNewline - Generic.Files.EndFileNoNewline - Generic.Files.LineEndings - Generic.Formatting.MultipleStatementAlignment - Generic.Formatting.SpaceAfterNot - Generic.PHP.LowerCaseConstant - Generic.Strings.UnnecessaryStringConcat - Generic.VersionControl.GitMergeConflict - Generic.WhiteSpace.DisallowTabIndent - Generic.WhiteSpace.DisallowSpaceIndent - Generic.WhiteSpace.IncrementDecrementSpacing - Generic.WhiteSpace.ScopeIndent - PEAR.ControlStructures.MultiLineCondition - PEAR.Functions.FunctionCallSignature - PEAR.Functions.FunctionDeclaration - Squiz.Commenting.DocCommentAlignment - Squiz.Commenting.FileComment - Squiz.Commenting.InlineComment - Squiz.Commenting.LongConditionClosingComment - Squiz.Commenting.PostStatementComment - Squiz.Formatting.OperatorBracket - Squiz.ControlStructures.ControlSignature - Squiz.ControlStructures.ForLoopDeclaration - Squiz.ControlStructures.SwitchDeclaration - Squiz.Functions.MultiLineFunctionDeclaration - Squiz.Operators.ComparisonOperatorUsage - Squiz.PHP.CommentedOutCode - Squiz.PHP.DisallowInlineIf - Squiz.PHP.DisallowSizeFunctionsInLoops - Squiz.WhiteSpace.ControlStructureSpacing - Squiz.WhiteSpace.FunctionClosingBraceSpace - Squiz.WhiteSpace.FunctionOpeningBraceSpace - Squiz.WhiteSpace.LogicalOperatorSpacing - Squiz.WhiteSpace.OperatorSpacing - Squiz.WhiteSpace.SemicolonSpacing - Squiz.WhiteSpace.SuperfluousWhitespace Ref: * squizlabs/PHP_CodeSniffer 2448 Co-authored-by: jrfnl <[email protected]>
1 parent 49c102b commit 660de75

File tree

187 files changed

+599
-8449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+599
-8449
lines changed

src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
class DocCommentSniff implements Sniff
1717
{
1818

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

3020
/**
3121
* Returns an array of tokens this test wants to listen for.

src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@
1717
class FixmeSniff implements Sniff
1818
{
1919

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

3121
/**
3222
* Returns an array of tokens this test wants to listen for.

src/Standards/Generic/Sniffs/Commenting/TodoSniff.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
class TodoSniff implements Sniff
1717
{
1818

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

3020
/**
3121
* Returns an array of tokens this test wants to listen for.

src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
class InlineControlStructureSniff implements Sniff
1717
{
1818

19-
/**
20-
* A list of tokenizers this sniff supports.
21-
*
22-
* @var array
23-
*/
24-
public $supportedTokenizers = [
25-
'PHP',
26-
'JS',
27-
];
28-
2919
/**
3020
* If true, an error will be thrown; otherwise a warning.
3121
*

src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@
1515
class EndFileNewlineSniff implements Sniff
1616
{
1717

18-
/**
19-
* A list of tokenizers this sniff supports.
20-
*
21-
* @var array
22-
*/
23-
public $supportedTokenizers = [
24-
'PHP',
25-
'JS',
26-
'CSS',
27-
];
28-
2918

3019
/**
3120
* Returns an array of tokens this test wants to listen for.

src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@
1515
class EndFileNoNewlineSniff implements Sniff
1616
{
1717

18-
/**
19-
* A list of tokenizers this sniff supports.
20-
*
21-
* @var array
22-
*/
23-
public $supportedTokenizers = [
24-
'PHP',
25-
'JS',
26-
'CSS',
27-
];
28-
2918

3019
/**
3120
* Returns an array of tokens this test wants to listen for.

src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@
1515
class LineEndingsSniff implements Sniff
1616
{
1717

18-
/**
19-
* A list of tokenizers this sniff supports.
20-
*
21-
* @var array
22-
*/
23-
public $supportedTokenizers = [
24-
'PHP',
25-
'JS',
26-
'CSS',
27-
];
28-
2918
/**
3019
* The valid EOL character.
3120
*
@@ -126,11 +115,6 @@ public function process(File $phpcsFile, $stackPtr)
126115
$tokenContent = $tokens[$i]['content'];
127116
}
128117

129-
if ($tokenContent === '') {
130-
// Special case for JS/CSS close tag.
131-
continue;
132-
}
133-
134118
$newContent = rtrim($tokenContent, "\r\n");
135119
$newContent .= $eolChar;
136120
if ($tokenContent !== $newContent) {

src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@
1919
class MultipleStatementAlignmentSniff implements Sniff
2020
{
2121

22-
/**
23-
* A list of tokenizers this sniff supports.
24-
*
25-
* @var array
26-
*/
27-
public $supportedTokenizers = [
28-
'PHP',
29-
'JS',
30-
];
31-
3222
/**
3323
* If true, an error will be thrown; otherwise a warning.
3424
*
@@ -137,7 +127,6 @@ public function checkAlignment($phpcsFile, $stackPtr, $end=null)
137127
$scopes = Tokens::$scopeOpeners;
138128
unset($scopes[T_CLOSURE]);
139129
unset($scopes[T_ANON_CLASS]);
140-
unset($scopes[T_OBJECT]);
141130

142131
for ($assign = $stackPtr; $assign < $end; $assign++) {
143132
if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) {

src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
class SpaceAfterNotSniff implements Sniff
1717
{
1818

19-
/**
20-
* A list of tokenizers this sniff supports.
21-
*
22-
* @var array
23-
*/
24-
public $supportedTokenizers = [
25-
'PHP',
26-
'JS',
27-
];
28-
2919
/**
3020
* The number of spaces desired after the NOT operator.
3121
*

src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
class LowerCaseConstantSniff implements Sniff
1717
{
1818

19-
/**
20-
* A list of tokenizers this sniff supports.
21-
*
22-
* @var array
23-
*/
24-
public $supportedTokenizers = [
25-
'PHP',
26-
'JS',
27-
];
28-
2919
/**
3020
* The tokens this sniff is targetting.
3121
*

0 commit comments

Comments
 (0)