Skip to content

Hard deprecate all sniffs which will be removed in PHPCS 4.0 #888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@

use PHP_CodeSniffer\Config;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Util\Common;

class CSSLintSniff implements Sniff
class CSSLintSniff implements Sniff, DeprecatedSniff
{

/**
Expand Down Expand Up @@ -95,4 +96,40 @@ public function process(File $phpcsFile, $stackPtr)
}//end process()


/**
* Provide the version number in which the sniff was deprecated.
*
* @return string
*/
public function getDeprecationVersion()
{
return 'v3.9.0';

}//end getDeprecationVersion()


/**
* Provide the version number in which the sniff will be removed.
*
* @return string
*/
public function getRemovalVersion()
{
return 'v4.0.0';

}//end getRemovalVersion()


/**
* Provide a custom message to display with the deprecation.
*
* @return string
*/
public function getDeprecationMessage()
{
return 'Support for scanning CSS files will be removed completely in v4.0.0.';

}//end getDeprecationMessage()


}//end class
39 changes: 38 additions & 1 deletion src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@

use PHP_CodeSniffer\Config;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Util\Common;

class ClosureLinterSniff implements Sniff
class ClosureLinterSniff implements Sniff, DeprecatedSniff
{

/**
Expand Down Expand Up @@ -116,4 +117,40 @@ public function process(File $phpcsFile, $stackPtr)
}//end process()


/**
* Provide the version number in which the sniff was deprecated.
*
* @return string
*/
public function getDeprecationVersion()
{
return 'v3.9.0';

}//end getDeprecationVersion()


/**
* Provide the version number in which the sniff will be removed.
*
* @return string
*/
public function getRemovalVersion()
{
return 'v4.0.0';

}//end getRemovalVersion()


/**
* Provide a custom message to display with the deprecation.
*
* @return string
*/
public function getDeprecationMessage()
{
return 'Support for scanning JavaScript files will be removed completely in v4.0.0.';

}//end getDeprecationMessage()


}//end class
39 changes: 38 additions & 1 deletion src/Standards/Generic/Sniffs/Debug/ESLintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@

use PHP_CodeSniffer\Config;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Util\Common;

class ESLintSniff implements Sniff
class ESLintSniff implements Sniff, DeprecatedSniff
{

/**
Expand Down Expand Up @@ -112,4 +113,40 @@ public function process(File $phpcsFile, $stackPtr)
}//end process()


/**
* Provide the version number in which the sniff was deprecated.
*
* @return string
*/
public function getDeprecationVersion()
{
return 'v3.9.0';

}//end getDeprecationVersion()


/**
* Provide the version number in which the sniff will be removed.
*
* @return string
*/
public function getRemovalVersion()
{
return 'v4.0.0';

}//end getRemovalVersion()


/**
* Provide a custom message to display with the deprecation.
*
* @return string
*/
public function getDeprecationMessage()
{
return 'Support for scanning JavaScript files will be removed completely in v4.0.0.';

}//end getDeprecationMessage()


}//end class
39 changes: 38 additions & 1 deletion src/Standards/Generic/Sniffs/Debug/JSHintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

use PHP_CodeSniffer\Config;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Util\Common;

class JSHintSniff implements Sniff
class JSHintSniff implements Sniff, DeprecatedSniff
{

/**
Expand Down Expand Up @@ -94,4 +95,40 @@ public function process(File $phpcsFile, $stackPtr)
}//end process()


/**
* Provide the version number in which the sniff was deprecated.
*
* @return string
*/
public function getDeprecationVersion()
{
return 'v3.9.0';

}//end getDeprecationVersion()


/**
* Provide the version number in which the sniff will be removed.
*
* @return string
*/
public function getRemovalVersion()
{
return 'v4.0.0';

}//end getRemovalVersion()


/**
* Provide a custom message to display with the deprecation.
*
* @return string
*/
public function getDeprecationMessage()
{
return 'Support for scanning JavaScript files will be removed completely in v4.0.0.';

}//end getDeprecationMessage()


}//end class
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting;

use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Util\Tokens;

class NoSpaceAfterCastSniff implements Sniff
class NoSpaceAfterCastSniff implements Sniff, DeprecatedSniff
{


Expand Down Expand Up @@ -58,4 +59,40 @@ public function process(File $phpcsFile, $stackPtr)
}//end process()


/**
* Provide the version number in which the sniff was deprecated.
*
* @return string
*/
public function getDeprecationVersion()
{
return 'v3.4.0';

}//end getDeprecationVersion()


/**
* Provide the version number in which the sniff will be removed.
*
* @return string
*/
public function getRemovalVersion()
{
return 'v4.0.0';

}//end getRemovalVersion()


/**
* Provide a custom message to display with the deprecation.
*
* @return string
*/
public function getDeprecationMessage()
{
return 'Use the Generic.Formatting.SpaceAfterCast sniff with the $spacing property set to 0 instead.';

}//end getDeprecationMessage()


}//end class
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions;

use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Util\Tokens;

class CallTimePassByReferenceSniff implements Sniff
class CallTimePassByReferenceSniff implements Sniff, DeprecatedSniff
{


Expand Down Expand Up @@ -140,4 +141,40 @@ public function process(File $phpcsFile, $stackPtr)
}//end process()


/**
* Provide the version number in which the sniff was deprecated.
*
* @return string
*/
public function getDeprecationVersion()
{
return 'v3.12.1';

}//end getDeprecationVersion()


/**
* Provide the version number in which the sniff will be removed.
*
* @return string
*/
public function getRemovalVersion()
{
return 'v4.0.0';

}//end getRemovalVersion()


/**
* Provide a custom message to display with the deprecation.
*
* @return string
*/
public function getDeprecationMessage()
{
return '';

}//end getDeprecationMessage()


}//end class
39 changes: 38 additions & 1 deletion src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

namespace PHP_CodeSniffer\Standards\MySource\Sniffs\CSS;

use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Files\File;

class BrowserSpecificStylesSniff implements Sniff
class BrowserSpecificStylesSniff implements Sniff, DeprecatedSniff
{

/**
Expand Down Expand Up @@ -86,4 +87,40 @@ public function process(File $phpcsFile, $stackPtr)
}//end process()


/**
* Provide the version number in which the sniff was deprecated.
*
* @return string
*/
public function getDeprecationVersion()
{
return 'v3.9.0';

}//end getDeprecationVersion()


/**
* Provide the version number in which the sniff will be removed.
*
* @return string
*/
public function getRemovalVersion()
{
return 'v4.0.0';

}//end getRemovalVersion()


/**
* Provide a custom message to display with the deprecation.
*
* @return string
*/
public function getDeprecationMessage()
{
return 'The MySource standard will be removed completely in v4.0.0.';

}//end getDeprecationMessage()


}//end class
Loading