From 3e9d8c01c8a994de145ce16cfa2b545e73d99ae4 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 13 Apr 2017 15:27:25 +0200 Subject: [PATCH] TASK: Rename TypoScript sniff * As we not only check ObjectIdentifier's anymore, but also further parts, renamce sniff to be more generic. * Also rename configuration and tests accordingly. Relates: #54 --- Documentation/source/configuration.rst | 12 ++++++------ .../TypoScript/{ObjectIdentifier => }/7.0.yaml | 0 .../TypoScript/{ObjectIdentifier => }/7.1.yaml | 0 src/Standards/Typo3Update/Sniffs/Options.php | 8 ++++---- ...ObjectIdentifierSniff.php => TypoScriptSniff.php} | 4 ++-- .../Expected.json | 0 .../InputFileForIssues.ts | 0 7 files changed, 12 insertions(+), 12 deletions(-) rename src/Standards/Typo3Update/Configuration/Removed/TypoScript/{ObjectIdentifier => }/7.0.yaml (100%) rename src/Standards/Typo3Update/Configuration/Removed/TypoScript/{ObjectIdentifier => }/7.1.yaml (100%) rename src/Standards/Typo3Update/Sniffs/Removed/{TypoScriptObjectIdentifierSniff.php => TypoScriptSniff.php} (94%) rename tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/{TypoScriptObjectIdentifierSniff => TypoScriptSniff}/Expected.json (100%) rename tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/{TypoScriptObjectIdentifierSniff => TypoScriptSniff}/InputFileForIssues.ts (100%) diff --git a/Documentation/source/configuration.rst b/Documentation/source/configuration.rst index df98fb8..cd2812d 100644 --- a/Documentation/source/configuration.rst +++ b/Documentation/source/configuration.rst @@ -157,13 +157,13 @@ Example: --runtime-set removedConstantConfigFiles "/Some/Absolute/Path/*.yaml" -.. _configuration-removedTypoScriptObjectIdentifierConfigFiles: +.. _configuration-removedTypoScriptConfigFiles: -removedTypoScriptObjectIdentifierConfigFiles --------------------------------------------- +removedTypoScriptConfigFiles +---------------------------- Configure where to look for configuration files defining the removed TypoScript object identifiers. -Default is ``Configuration/Removed/TypoScript/ObjectIdentifier/*.yaml`` inside the standard itself. +Default is ``Configuration/Removed/TypoScript/*.yaml`` inside the standard itself. We already try to deliver as much as possible. Globing is used, so placeholders like ``*`` are possible, see https://secure.php.net/manual/en/function.glob.php @@ -171,10 +171,10 @@ Using :file:`ruleset.xml`: .. code:: xml - + Example: .. code:: bash - --runtime-set removedTypoScriptObjectIdentifierConfigFiles "/Some/Absolute/Path/*.yaml" + --runtime-set removedTypoScriptConfigFiles "/Some/Absolute/Path/*.yaml" diff --git a/src/Standards/Typo3Update/Configuration/Removed/TypoScript/ObjectIdentifier/7.0.yaml b/src/Standards/Typo3Update/Configuration/Removed/TypoScript/7.0.yaml similarity index 100% rename from src/Standards/Typo3Update/Configuration/Removed/TypoScript/ObjectIdentifier/7.0.yaml rename to src/Standards/Typo3Update/Configuration/Removed/TypoScript/7.0.yaml diff --git a/src/Standards/Typo3Update/Configuration/Removed/TypoScript/ObjectIdentifier/7.1.yaml b/src/Standards/Typo3Update/Configuration/Removed/TypoScript/7.1.yaml similarity index 100% rename from src/Standards/Typo3Update/Configuration/Removed/TypoScript/ObjectIdentifier/7.1.yaml rename to src/Standards/Typo3Update/Configuration/Removed/TypoScript/7.1.yaml diff --git a/src/Standards/Typo3Update/Sniffs/Options.php b/src/Standards/Typo3Update/Sniffs/Options.php index bae8ef0..cc79f7b 100644 --- a/src/Standards/Typo3Update/Sniffs/Options.php +++ b/src/Standards/Typo3Update/Sniffs/Options.php @@ -82,15 +82,15 @@ class Options } /** - * Returns an array of absolute file names containing removed typoscript object identifier configurations. + * Returns an array of absolute file names containing removed typoscript. * * @return array */ - public static function getRemovedTypoScriptObjectIdentifierConfigFiles() + public static function getRemovedTypoScriptConfigFiles() { return static::getOptionFileNames( - 'removedTypoScriptObjectIdentifier', - __DIR__ . '/../Configuration/Removed/TypoScript/ObjectIdentifier/*.yaml' + 'removedTypoScript', + __DIR__ . '/../Configuration/Removed/TypoScript/*.yaml' ); } diff --git a/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptObjectIdentifierSniff.php b/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff.php similarity index 94% rename from src/Standards/Typo3Update/Sniffs/Removed/TypoScriptObjectIdentifierSniff.php rename to src/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff.php index 0bc61f4..f812edb 100644 --- a/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptObjectIdentifierSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff.php @@ -5,7 +5,7 @@ use PHP_CodeSniffer_File as PhpCsFile; use Typo3Update\Sniffs\Options; use Typo3Update\Sniffs\Removed\AbstractGenericUsage; -class Typo3Update_Sniffs_Removed_TypoScriptObjectIdentifierSniff extends AbstractGenericUsage +class Typo3Update_Sniffs_Removed_TypoScriptSniff extends AbstractGenericUsage { public $supportedTokenizers = [ 'TYPOSCRIPT', @@ -112,6 +112,6 @@ class Typo3Update_Sniffs_Removed_TypoScriptObjectIdentifierSniff extends Abstrac */ protected function getRemovedConfigFiles() { - return Options::getRemovedTypoScriptObjectIdentifierConfigFiles(); + return Options::getRemovedTypoScriptConfigFiles(); } } diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/TypoScriptObjectIdentifierSniff/Expected.json b/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff/Expected.json similarity index 100% rename from tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/TypoScriptObjectIdentifierSniff/Expected.json rename to tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff/Expected.json diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/TypoScriptObjectIdentifierSniff/InputFileForIssues.ts b/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff/InputFileForIssues.ts similarity index 100% rename from tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/TypoScriptObjectIdentifierSniff/InputFileForIssues.ts rename to tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/TypoScriptSniff/InputFileForIssues.ts