From ded389aeca903a7f6a118aa8c7f8569b8b7c12cd Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 30 May 2017 14:47:46 +0200 Subject: [PATCH] TASK: Update PHP CS * Use hash, not version, as version contains bug that not a single custom sniff can be executed. That would break our tests. * Also add auto loading for tests to work, as phpcs removed autoloading support for composer. * Move all sniffs to namespace to allow processing through phpcs. * Adjust already some class names of phpcs to new conventions. Relates: #82 --- composer.json | 8 ++++---- .../Typo3Update/AbstractYamlRemovedUsage.php | 2 +- .../Typo3Update/Feature/AbstractYamlRemovedUsage.php | 2 +- .../Typo3Update/Feature/FeatureInterface.php | 4 ++-- src/Standards/Typo3Update/Feature/Features.php | 2 +- .../Typo3Update/Feature/FeaturesSupport.php | 2 +- .../Typo3Update/Feature/LegacyClassnameFeature.php | 6 +++--- .../Typo3Update/Feature/RemovedClassFeature.php | 2 +- src/Standards/Typo3Update/Options.php | 4 ++-- .../Sniffs/Classname/AbstractClassnameChecker.php | 4 ++-- .../Sniffs/Classname/InheritanceSniff.php | 7 ++++--- .../Sniffs/Classname/InlineCommentSniff.php | 7 ++++--- .../Typo3Update/Sniffs/Classname/InstanceofSniff.php | 6 +++--- .../Classname/InstantiationWithMakeInstanceSniff.php | 9 +++++---- .../Sniffs/Classname/InstantiationWithNewSniff.php | 6 +++--- .../InstantiationWithObjectManagerSniff.php | 9 +++++---- .../Typo3Update/Sniffs/Classname/IsACallSniff.php | 7 ++++--- .../Sniffs/Classname/PhpDocCommentSniff.php | 8 +++++--- .../Typo3Update/Sniffs/Classname/StaticCallSniff.php | 5 ++--- .../Typo3Update/Sniffs/Classname/StringSniff.php | 6 +++--- .../Sniffs/Classname/TypeHintCatchExceptionSniff.php | 6 +++--- .../Typo3Update/Sniffs/Classname/TypeHintSniff.php | 7 ++++--- .../Typo3Update/Sniffs/Classname/UseSniff.php | 7 ++++--- .../Sniffs/Deprecated/AjaxRegistrationSniff.php | 12 +++++++----- .../Typo3Update/Sniffs/ExtendedPhpCsSupportTrait.php | 4 ++-- .../Sniffs/LegacyClassname/MissingNamespaceSniff.php | 8 +++++--- .../MissingVendorForPluginsAndModulesSniff.php | 10 ++++++---- .../Sniffs/Removed/AbstractGenericPhpUsage.php | 4 ++-- .../Sniffs/Removed/AbstractGenericUsage.php | 4 ++-- .../Sniffs/Removed/GenericConstantUsageSniff.php | 4 +++- .../Sniffs/Removed/GenericFunctionCallSniff.php | 7 ++++--- .../Typo3Update/Sniffs/Removed/GenericHookSniff.php | 9 +++++---- .../Sniffs/Removed/GenericSignalSniff.php | 7 ++++--- .../Sniffs/Removed/TypoScriptConstantSniff.php | 7 ++++--- .../Typo3Update/Sniffs/Removed/TypoScriptSniff.php | 7 ++++--- 35 files changed, 115 insertions(+), 94 deletions(-) diff --git a/composer.json b/composer.json index 1aee406..f708bf3 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ ], "autoload-dev": { "psr-4": { - "Typo3Update\\Tests\\": "tests/" + "Typo3Update\\Tests\\": "tests/", + "PHP_CodeSniffer\\": "vendor/squizlabs/php_codesniffer/src/" } }, "autoload": { @@ -26,9 +27,8 @@ "require": { "php": ">=5.6", "helmich/typo3-typoscript-parser": "1.1.*", - "squizlabs/php_codesniffer": "2.8.*", - "symfony/yaml": "3.2.*", - "higidi/composer-phpcodesniffer-standards-plugin": "*" + "squizlabs/php_codesniffer": "dev-master#92a902f", + "symfony/yaml": "3.2.*" }, "require-dev": { "phpunit/phpunit": "5.7.*", diff --git a/src/Standards/Typo3Update/AbstractYamlRemovedUsage.php b/src/Standards/Typo3Update/AbstractYamlRemovedUsage.php index e753605..72cec20 100644 --- a/src/Standards/Typo3Update/AbstractYamlRemovedUsage.php +++ b/src/Standards/Typo3Update/AbstractYamlRemovedUsage.php @@ -20,7 +20,7 @@ namespace Typo3Update; * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; +use PHP_CodeSniffer\Files\File as PhpCsFile; use Typo3Update\RemovedByYamlConfiguration; /** diff --git a/src/Standards/Typo3Update/Feature/AbstractYamlRemovedUsage.php b/src/Standards/Typo3Update/Feature/AbstractYamlRemovedUsage.php index 2a1fb9f..2fee965 100644 --- a/src/Standards/Typo3Update/Feature/AbstractYamlRemovedUsage.php +++ b/src/Standards/Typo3Update/Feature/AbstractYamlRemovedUsage.php @@ -20,7 +20,7 @@ namespace Typo3Update\Feature; * 02110-1301, USA. */ -use PHP_CodeSniffer_Sniff as PhpCsSniff; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; use Typo3Update\AbstractYamlRemovedUsage as BaseAbstractYamlRemovedUsage; abstract class AbstractYamlRemovedUsage extends BaseAbstractYamlRemovedUsage implements FeatureInterface diff --git a/src/Standards/Typo3Update/Feature/FeatureInterface.php b/src/Standards/Typo3Update/Feature/FeatureInterface.php index 8ab83a7..d9ed26b 100644 --- a/src/Standards/Typo3Update/Feature/FeatureInterface.php +++ b/src/Standards/Typo3Update/Feature/FeatureInterface.php @@ -20,8 +20,8 @@ namespace Typo3Update\Feature; * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Sniff as PhpCsSniff; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; /** * See "Features" in documentation. diff --git a/src/Standards/Typo3Update/Feature/Features.php b/src/Standards/Typo3Update/Feature/Features.php index befea8f..3674dbf 100644 --- a/src/Standards/Typo3Update/Feature/Features.php +++ b/src/Standards/Typo3Update/Feature/Features.php @@ -20,7 +20,7 @@ namespace Typo3Update\Feature; * 02110-1301, USA. */ -use PHP_CodeSniffer_Sniff as PhpCsSniff; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; use Typo3Update\Options; /** diff --git a/src/Standards/Typo3Update/Feature/FeaturesSupport.php b/src/Standards/Typo3Update/Feature/FeaturesSupport.php index 26975c5..2bf6c92 100644 --- a/src/Standards/Typo3Update/Feature/FeaturesSupport.php +++ b/src/Standards/Typo3Update/Feature/FeaturesSupport.php @@ -20,7 +20,7 @@ namespace Typo3Update\Feature; * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; +use PHP_CodeSniffer\Files\File as PhpCsFile; /** * Provides "feature" support for sniffs. diff --git a/src/Standards/Typo3Update/Feature/LegacyClassnameFeature.php b/src/Standards/Typo3Update/Feature/LegacyClassnameFeature.php index e11902d..5be54a4 100644 --- a/src/Standards/Typo3Update/Feature/LegacyClassnameFeature.php +++ b/src/Standards/Typo3Update/Feature/LegacyClassnameFeature.php @@ -20,9 +20,9 @@ namespace Typo3Update\Feature; * 02110-1301, USA. */ -use PHP_CodeSniffer as PhpCs; -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Sniff as PhpCsSniff; +use PHP_CodeSniffer\Util\Common as PhpCs; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; use Typo3Update_Sniffs_Classname_StringSniff as StringSniff; /** diff --git a/src/Standards/Typo3Update/Feature/RemovedClassFeature.php b/src/Standards/Typo3Update/Feature/RemovedClassFeature.php index 5584dfc..dff07bd 100644 --- a/src/Standards/Typo3Update/Feature/RemovedClassFeature.php +++ b/src/Standards/Typo3Update/Feature/RemovedClassFeature.php @@ -20,7 +20,7 @@ namespace Typo3Update\Feature; * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; +use PHP_CodeSniffer\Files\File as PhpCsFile; use Typo3Update\Options; class RemovedClassFeature extends AbstractYamlRemovedUsage diff --git a/src/Standards/Typo3Update/Options.php b/src/Standards/Typo3Update/Options.php index d5097fc..fb3d1c6 100644 --- a/src/Standards/Typo3Update/Options.php +++ b/src/Standards/Typo3Update/Options.php @@ -20,7 +20,7 @@ namespace Typo3Update; * 02110-1301, USA. */ -use PHP_CodeSniffer as PhpCs; +use PHP_CodeSniffer\Config as Config; use Symfony\Component\Yaml\Yaml; /** @@ -157,7 +157,7 @@ class Options */ private static function getOptionWithDefault($optionName, $default) { - $option = PhpCs::getConfigData($optionName); + $option = Config::getConfigData($optionName); if (!$option) { $option = $default; } diff --git a/src/Standards/Typo3Update/Sniffs/Classname/AbstractClassnameChecker.php b/src/Standards/Typo3Update/Sniffs/Classname/AbstractClassnameChecker.php index e405fdc..4a29120 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/AbstractClassnameChecker.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/AbstractClassnameChecker.php @@ -20,8 +20,8 @@ namespace Typo3Update\Sniffs\Classname; * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Sniff as PhpCsSniff; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; use Typo3Update\Feature\FeaturesSupport; /** diff --git a/src/Standards/Typo3Update/Sniffs/Classname/InheritanceSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/InheritanceSniff.php index 2ce6d36..fa80717 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/InheritanceSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/InheritanceSniff.php @@ -1,5 +1,7 @@ * @@ -19,10 +21,9 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; +use PHP_CodeSniffer\Files\File as PhpCsFile; -class Typo3Update_Sniffs_Classname_InheritanceSniff extends AbstractClassnameChecker +class InheritanceSniff extends AbstractClassnameChecker { /** * Returns the token types that this sniff is interested in. diff --git a/src/Standards/Typo3Update/Sniffs/Classname/InlineCommentSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/InlineCommentSniff.php index 676dad9..f4a260f 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/InlineCommentSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/InlineCommentSniff.php @@ -1,5 +1,7 @@ * @@ -19,10 +21,9 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; +use PHP_CodeSniffer\Files\File as PhpCsFile; -class Typo3Update_Sniffs_Classname_InlineCommentSniff extends AbstractClassnameChecker +class InlineCommentSniff extends AbstractClassnameChecker { /** * Returns the token types that this sniff is interested in. diff --git a/src/Standards/Typo3Update/Sniffs/Classname/InstanceofSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/InstanceofSniff.php index b6a4640..51fdf4b 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/InstanceofSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/InstanceofSniff.php @@ -1,5 +1,7 @@ * @@ -19,9 +21,7 @@ * 02110-1301, USA. */ -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; - -class Typo3Update_Sniffs_Classname_InstanceofSniff extends AbstractClassnameChecker +class InstanceofSniff extends AbstractClassnameChecker { /** * Returns the token types that this sniff is interested in. diff --git a/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithMakeInstanceSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithMakeInstanceSniff.php index 070162a..b14de99 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithMakeInstanceSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithMakeInstanceSniff.php @@ -1,5 +1,7 @@ * @@ -19,11 +21,10 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Tokens as Tokens; -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Util\Tokens as Tokens; -class Typo3Update_Sniffs_Classname_InstantiationWithMakeInstanceSniff extends AbstractClassnameChecker +class InstantiationWithMakeInstanceSniff extends AbstractClassnameChecker { use \Typo3Update\Sniffs\ExtendedPhpCsSupportTrait; diff --git a/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithNewSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithNewSniff.php index 37313c7..67e4fc6 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithNewSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithNewSniff.php @@ -1,5 +1,7 @@ * @@ -19,9 +21,7 @@ * 02110-1301, USA. */ -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; - -class Typo3Update_Sniffs_Classname_InstantiationWithNewSniff extends AbstractClassnameChecker +class InstantiationWithNewSniff extends AbstractClassnameChecker { /** * Returns the token types that this sniff is interested in. diff --git a/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithObjectManagerSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithObjectManagerSniff.php index 7843243..59879fc 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithObjectManagerSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/InstantiationWithObjectManagerSniff.php @@ -1,5 +1,7 @@ * @@ -19,11 +21,10 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Tokens as Tokens; -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Util\Tokens as Tokens; -class Typo3Update_Sniffs_Classname_InstantiationWithObjectManagerSniff extends AbstractClassnameChecker +class InstantiationWithObjectManagerSniff extends AbstractClassnameChecker { use \Typo3Update\Sniffs\ExtendedPhpCsSupportTrait; diff --git a/src/Standards/Typo3Update/Sniffs/Classname/IsACallSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/IsACallSniff.php index 7888d01..dcf87b5 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/IsACallSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/IsACallSniff.php @@ -1,5 +1,7 @@ * @@ -19,10 +21,9 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpcsFile; -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; +use PHP_CodeSniffer\Files\File as PhpcsFile; -class Typo3Update_Sniffs_Classname_IsACallSniff extends AbstractClassnameChecker +class IsACallSniff extends AbstractClassnameChecker { use \Typo3Update\Sniffs\ExtendedPhpCsSupportTrait; diff --git a/src/Standards/Typo3Update/Sniffs/Classname/PhpDocCommentSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/PhpDocCommentSniff.php index f00fd12..8c11067 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/PhpDocCommentSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/PhpDocCommentSniff.php @@ -1,5 +1,7 @@ * @@ -19,8 +21,8 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Sniff as PhpCsSniff; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; use Typo3Update\Feature\FeaturesSupport; /** @@ -30,7 +32,7 @@ use Typo3Update\Feature\FeaturesSupport; * * Will do nothing itself, but call features. */ -class Typo3Update_Sniffs_Classname_PhpDocCommentSniff implements PhpCsSniff +class PhpDocCommentSniff implements PhpCsSniff { use FeaturesSupport; diff --git a/src/Standards/Typo3Update/Sniffs/Classname/StaticCallSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/StaticCallSniff.php index ded2b6d..7dfe412 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/StaticCallSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/StaticCallSniff.php @@ -1,5 +1,6 @@ * @@ -19,9 +20,7 @@ * 02110-1301, USA. */ -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; - -class Typo3Update_Sniffs_Classname_StaticCallSniff extends AbstractClassnameChecker +class StaticCallSniff extends AbstractClassnameChecker { /** * Define whether the T_STRING default behaviour should be checked before diff --git a/src/Standards/Typo3Update/Sniffs/Classname/StringSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/StringSniff.php index a4414a1..dc21656 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/StringSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/StringSniff.php @@ -19,9 +19,9 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Sniff as PhpCsSniff; -use PHP_CodeSniffer_Tokens as PhpCsTokens; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; +use PHP_CodeSniffer\Util\Tokens as PhpCsTokens; use Typo3Update\Feature\FeaturesSupport; class Typo3Update_Sniffs_Classname_StringSniff implements PhpCsSniff diff --git a/src/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff.php index 231b676..28c99b7 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff.php @@ -1,5 +1,7 @@ * @@ -19,9 +21,7 @@ * 02110-1301, USA. */ -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; - -class Typo3Update_Sniffs_Classname_TypeHintCatchExceptionSniff extends AbstractClassnameChecker +class TypeHintCatchExceptionSniff extends AbstractClassnameChecker { /** * Returns the token types that this sniff is interested in. diff --git a/src/Standards/Typo3Update/Sniffs/Classname/TypeHintSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/TypeHintSniff.php index 05f49c1..0796955 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/TypeHintSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/TypeHintSniff.php @@ -1,5 +1,7 @@ * @@ -19,10 +21,9 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; +use PHP_CodeSniffer\Files\File as PhpCsFile; -class Typo3Update_Sniffs_Classname_TypeHintSniff extends AbstractClassnameChecker +class TypeHintSniff extends AbstractClassnameChecker { /** * Returns the token types that this sniff is interested in. diff --git a/src/Standards/Typo3Update/Sniffs/Classname/UseSniff.php b/src/Standards/Typo3Update/Sniffs/Classname/UseSniff.php index 67c00e6..641505d 100644 --- a/src/Standards/Typo3Update/Sniffs/Classname/UseSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Classname/UseSniff.php @@ -1,5 +1,7 @@ * @@ -19,10 +21,9 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use Typo3Update\Sniffs\Classname\AbstractClassnameChecker; +use PHP_CodeSniffer\Files\File as PhpCsFile; -class Typo3Update_Sniffs_Classname_UseSniff extends AbstractClassnameChecker +class UseSniff extends AbstractClassnameChecker { /** * Returns the token types that this sniff is interested in. diff --git a/src/Standards/Typo3Update/Sniffs/Deprecated/AjaxRegistrationSniff.php b/src/Standards/Typo3Update/Sniffs/Deprecated/AjaxRegistrationSniff.php index 1c4f230..e6b54ac 100644 --- a/src/Standards/Typo3Update/Sniffs/Deprecated/AjaxRegistrationSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Deprecated/AjaxRegistrationSniff.php @@ -1,5 +1,7 @@ * @@ -19,16 +21,16 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Sniff as PhpCsSniff; -use PHP_CodeSniffer_Tokens as PhpCsTokens; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; +use PHP_CodeSniffer\Util\Tokens as PhpCsTokens; /** * Analyses feature 6991. * * @see https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.6/Feature-69916-PSR-7-basedRoutingForBackendAJAXRequests.html */ -class Typo3Update_Sniffs_Deprecated_AjaxRegistrationSniff implements PhpCsSniff +class AjaxRegistrationSniff implements PhpCsSniff { /** * Defines files to check. @@ -88,7 +90,7 @@ class Typo3Update_Sniffs_Deprecated_AjaxRegistrationSniff implements PhpCsSniff . ' Since TYPO3 7.6, use PSR-7-based Routing for Backend AJAX Requests.' . ' See: %s', $tokenToCheck, - '', + '6991', [ "\$GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX'][\$ajaxID]", $token['content'], diff --git a/src/Standards/Typo3Update/Sniffs/ExtendedPhpCsSupportTrait.php b/src/Standards/Typo3Update/Sniffs/ExtendedPhpCsSupportTrait.php index 01898b0..72717a7 100644 --- a/src/Standards/Typo3Update/Sniffs/ExtendedPhpCsSupportTrait.php +++ b/src/Standards/Typo3Update/Sniffs/ExtendedPhpCsSupportTrait.php @@ -20,8 +20,8 @@ namespace Typo3Update\Sniffs; * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpcsFile; -use PHP_CodeSniffer_Tokens as Tokens; +use PHP_CodeSniffer\Files\File as PhpcsFile; +use PHP_CodeSniffer\Util\Tokens as Tokens; /** * Provide common uses for all sniffs. diff --git a/src/Standards/Typo3Update/Sniffs/LegacyClassname/MissingNamespaceSniff.php b/src/Standards/Typo3Update/Sniffs/LegacyClassname/MissingNamespaceSniff.php index 28a5b89..9a55a1a 100644 --- a/src/Standards/Typo3Update/Sniffs/LegacyClassname/MissingNamespaceSniff.php +++ b/src/Standards/Typo3Update/Sniffs/LegacyClassname/MissingNamespaceSniff.php @@ -1,5 +1,7 @@ * @@ -19,15 +21,15 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Sniff as PhpCsSniff; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; use Typo3Update\Feature\LegacyClassnameMapping; use Typo3Update\Options; /** * Detect missing namespaces for class definitions. */ -class Typo3Update_Sniffs_LegacyClassname_MissingNamespaceSniff implements PhpCsSniff +class MissingNamespaceSniff implements PhpCsSniff { /** * Returns the token types that this sniff is interested in. diff --git a/src/Standards/Typo3Update/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniff.php b/src/Standards/Typo3Update/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniff.php index 057f197..4957b11 100644 --- a/src/Standards/Typo3Update/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniff.php +++ b/src/Standards/Typo3Update/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniff.php @@ -1,5 +1,7 @@ * @@ -19,15 +21,15 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Sniff as PhpCsSniff; -use PHP_CodeSniffer_Tokens as Tokens; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; +use PHP_CodeSniffer\Util\Tokens as Tokens; use Typo3Update\Options; /** * Detect whether vendor is missing for plugins and modules registrations and configurations. */ -class Typo3Update_Sniffs_LegacyClassname_MissingVendorForPluginsAndModulesSniff implements PhpCsSniff +class MissingVendorForPluginsAndModulesSniff implements PhpCsSniff { use \Typo3Update\Sniffs\ExtendedPhpCsSupportTrait; diff --git a/src/Standards/Typo3Update/Sniffs/Removed/AbstractGenericPhpUsage.php b/src/Standards/Typo3Update/Sniffs/Removed/AbstractGenericPhpUsage.php index 99c81d1..4a41cfe 100644 --- a/src/Standards/Typo3Update/Sniffs/Removed/AbstractGenericPhpUsage.php +++ b/src/Standards/Typo3Update/Sniffs/Removed/AbstractGenericPhpUsage.php @@ -20,7 +20,7 @@ namespace Typo3Update\Sniffs\Removed; * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; +use PHP_CodeSniffer\Files\File as PhpCsFile; abstract class AbstractGenericPhpUsage extends AbstractGenericUsage { @@ -142,7 +142,7 @@ abstract class AbstractGenericPhpUsage extends AbstractGenericUsage { $name = $config['name']; if ($config['class']) { - $name = $config['class'] . '.' . $name; + $name = $config['class'] . ':' . $name; } return $name; diff --git a/src/Standards/Typo3Update/Sniffs/Removed/AbstractGenericUsage.php b/src/Standards/Typo3Update/Sniffs/Removed/AbstractGenericUsage.php index 557dcb5..d533e78 100644 --- a/src/Standards/Typo3Update/Sniffs/Removed/AbstractGenericUsage.php +++ b/src/Standards/Typo3Update/Sniffs/Removed/AbstractGenericUsage.php @@ -20,8 +20,8 @@ namespace Typo3Update\Sniffs\Removed; * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Sniff as PhpCsSniff; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Sniffs\Sniff as PhpCsSniff; use Typo3Update\AbstractYamlRemovedUsage as BaseAbstractYamlRemovedUsage; abstract class AbstractGenericUsage extends BaseAbstractYamlRemovedUsage implements PhpCsSniff diff --git a/src/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff.php b/src/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff.php index e42a07d..5221623 100644 --- a/src/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff.php @@ -1,5 +1,7 @@ * @@ -22,7 +24,7 @@ use Typo3Update\Sniffs\Removed\AbstractGenericPhpUsage; use Typo3Update\Options; -class Typo3Update_Sniffs_Removed_GenericConstantUsageSniff extends AbstractGenericPhpUsage +class GenericConstantUsageSniff extends AbstractGenericPhpUsage { protected function getOldUsage(array $config) { diff --git a/src/Standards/Typo3Update/Sniffs/Removed/GenericFunctionCallSniff.php b/src/Standards/Typo3Update/Sniffs/Removed/GenericFunctionCallSniff.php index 2915a87..0160840 100644 --- a/src/Standards/Typo3Update/Sniffs/Removed/GenericFunctionCallSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Removed/GenericFunctionCallSniff.php @@ -1,5 +1,7 @@ * @@ -19,12 +21,11 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; +use PHP_CodeSniffer\Files\File as PhpCsFile; use Typo3Update\Options; use Typo3Update\Sniffs\ExtendedPhpCsSupportTrait; -use Typo3Update\Sniffs\Removed\AbstractGenericPhpUsage; -class Typo3Update_Sniffs_Removed_GenericFunctionCallSniff extends AbstractGenericPhpUsage +class GenericFunctionCallSniff extends AbstractGenericPhpUsage { use ExtendedPhpCsSupportTrait; diff --git a/src/Standards/Typo3Update/Sniffs/Removed/GenericHookSniff.php b/src/Standards/Typo3Update/Sniffs/Removed/GenericHookSniff.php index 75a1ecf..5a05039 100644 --- a/src/Standards/Typo3Update/Sniffs/Removed/GenericHookSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Removed/GenericHookSniff.php @@ -1,5 +1,7 @@ * @@ -19,13 +21,12 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; -use PHP_CodeSniffer_Tokens as PhpCsTokens; +use PHP_CodeSniffer\Files\File as PhpCsFile; +use PHP_CodeSniffer\Util\Tokens as PhpCsTokens; use Typo3Update\Options; use Typo3Update\Sniffs\ExtendedPhpCsSupportTrait; -use Typo3Update\Sniffs\Removed\AbstractGenericPhpUsage; -class Typo3Update_Sniffs_Removed_GenericHookSniff extends AbstractGenericPhpUsage +class GenericHookSniff extends AbstractGenericPhpUsage { use ExtendedPhpCsSupportTrait; diff --git a/src/Standards/Typo3Update/Sniffs/Removed/GenericSignalSniff.php b/src/Standards/Typo3Update/Sniffs/Removed/GenericSignalSniff.php index d72601c..49ec377 100644 --- a/src/Standards/Typo3Update/Sniffs/Removed/GenericSignalSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Removed/GenericSignalSniff.php @@ -1,5 +1,7 @@ * @@ -19,12 +21,11 @@ * 02110-1301, USA. */ -use PHP_CodeSniffer_File as PhpCsFile; +use PHP_CodeSniffer\Files\File as PhpCsFile; use Typo3Update\Options; use Typo3Update\Sniffs\ExtendedPhpCsSupportTrait; -use Typo3Update\Sniffs\Removed\AbstractGenericPhpUsage; -class Typo3Update_Sniffs_Removed_GenericSignalSniff extends AbstractGenericPhpUsage +class GenericSignalSniff extends AbstractGenericPhpUsage { use ExtendedPhpCsSupportTrait; diff --git a/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptConstantSniff.php b/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptConstantSniff.php index c396d32..fc9ad11 100644 --- a/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptConstantSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptConstantSniff.php @@ -1,5 +1,7 @@ * @@ -20,11 +22,10 @@ */ use Helmich\TypoScriptParser\Tokenizer\TokenInterface; -use PHP_CodeSniffer_File as PhpCsFile; +use PHP_CodeSniffer\Files\File as PhpCsFile; use Typo3Update\Options; -use Typo3Update\Sniffs\Removed\AbstractGenericUsage; -class Typo3Update_Sniffs_Removed_TypoScriptConstantSniff extends AbstractGenericUsage +class TypoScriptConstantSniff extends AbstractGenericUsage { /** * Register sniff only for TypoScript. diff --git a/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff.php b/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff.php index a2c3686..13ebfbb 100644 --- a/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff.php @@ -1,5 +1,7 @@ * @@ -20,12 +22,11 @@ */ use Helmich\TypoScriptParser\Tokenizer\TokenInterface; -use PHP_CodeSniffer_File as PhpCsFile; +use PHP_CodeSniffer\Files\File as PhpCsFile; use Typo3Update\CodeSniffer\Tokenizers\FQObjectIdentifier; use Typo3Update\Options; -use Typo3Update\Sniffs\Removed\AbstractGenericUsage; -class Typo3Update_Sniffs_Removed_TypoScriptSniff extends AbstractGenericUsage +class TypoScriptSniff extends AbstractGenericUsage { /** * Register sniff only for TypoScript.