Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 69430c5

Browse files
authoredApr 14, 2025··
Merge pull request #888 from PHPCSStandards/feature/188-deprecate-all-sniffs-removed-in-4.0
Hard deprecate all sniffs which will be removed in PHPCS 4.0
2 parents aa6eed0 + dd7257e commit 69430c5

File tree

48 files changed

+1824
-48
lines changed

Some content is hidden

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

48 files changed

+1824
-48
lines changed
 

‎src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313

1414
use PHP_CodeSniffer\Config;
1515
use PHP_CodeSniffer\Files\File;
16+
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
1617
use PHP_CodeSniffer\Sniffs\Sniff;
1718
use PHP_CodeSniffer\Util\Common;
1819

19-
class CSSLintSniff implements Sniff
20+
class CSSLintSniff implements Sniff, DeprecatedSniff
2021
{
2122

2223
/**
@@ -95,4 +96,40 @@ public function process(File $phpcsFile, $stackPtr)
9596
}//end process()
9697

9798

99+
/**
100+
* Provide the version number in which the sniff was deprecated.
101+
*
102+
* @return string
103+
*/
104+
public function getDeprecationVersion()
105+
{
106+
return 'v3.9.0';
107+
108+
}//end getDeprecationVersion()
109+
110+
111+
/**
112+
* Provide the version number in which the sniff will be removed.
113+
*
114+
* @return string
115+
*/
116+
public function getRemovalVersion()
117+
{
118+
return 'v4.0.0';
119+
120+
}//end getRemovalVersion()
121+
122+
123+
/**
124+
* Provide a custom message to display with the deprecation.
125+
*
126+
* @return string
127+
*/
128+
public function getDeprecationMessage()
129+
{
130+
return 'Support for scanning CSS files will be removed completely in v4.0.0.';
131+
132+
}//end getDeprecationMessage()
133+
134+
98135
}//end class

‎src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313

1414
use PHP_CodeSniffer\Config;
1515
use PHP_CodeSniffer\Files\File;
16+
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
1617
use PHP_CodeSniffer\Sniffs\Sniff;
1718
use PHP_CodeSniffer\Util\Common;
1819

19-
class ClosureLinterSniff implements Sniff
20+
class ClosureLinterSniff implements Sniff, DeprecatedSniff
2021
{
2122

2223
/**
@@ -116,4 +117,40 @@ public function process(File $phpcsFile, $stackPtr)
116117
}//end process()
117118

118119

120+
/**
121+
* Provide the version number in which the sniff was deprecated.
122+
*
123+
* @return string
124+
*/
125+
public function getDeprecationVersion()
126+
{
127+
return 'v3.9.0';
128+
129+
}//end getDeprecationVersion()
130+
131+
132+
/**
133+
* Provide the version number in which the sniff will be removed.
134+
*
135+
* @return string
136+
*/
137+
public function getRemovalVersion()
138+
{
139+
return 'v4.0.0';
140+
141+
}//end getRemovalVersion()
142+
143+
144+
/**
145+
* Provide a custom message to display with the deprecation.
146+
*
147+
* @return string
148+
*/
149+
public function getDeprecationMessage()
150+
{
151+
return 'Support for scanning JavaScript files will be removed completely in v4.0.0.';
152+
153+
}//end getDeprecationMessage()
154+
155+
119156
}//end class

0 commit comments

Comments
 (0)
Please sign in to comment.