Skip to content
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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
@@ -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
{

/**
@@ -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
@@ -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
{

/**
@@ -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
@@ -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
{

/**
@@ -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
@@ -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
{

/**
@@ -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
@@ -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
{


@@ -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
39 changes: 38 additions & 1 deletion src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php
Original file line number Diff line number Diff line change
@@ -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
{

/**
@@ -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
Original file line number Diff line number Diff line change
@@ -11,11 +11,12 @@

namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels;

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

class DisallowSelfActionsSniff implements Sniff
class DisallowSelfActionsSniff implements Sniff, DeprecatedSniff
{


@@ -124,4 +125,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