From 9e3f7ac1e507713d021c39967428dabb58c2dc59 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 2 May 2017 08:09:10 +0200 Subject: [PATCH] TASK: Fix MR issues * Remove construct from interface. * Fix wrong type hints. * Keep naming of variable in sync. * Also keep conditions format in sync. Relates: #71 --- .../Typo3Update/AbstractYamlRemovedUsage.php | 16 ++++++++-------- .../Typo3Update/Feature/FeatureInterface.php | 5 ----- .../Typo3Update/Feature/RemovedClassFeature.php | 2 +- .../Typo3Update/RemovedByYamlConfiguration.php | 2 +- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/Standards/Typo3Update/AbstractYamlRemovedUsage.php b/src/Standards/Typo3Update/AbstractYamlRemovedUsage.php index 37d1c4e..e753605 100644 --- a/src/Standards/Typo3Update/AbstractYamlRemovedUsage.php +++ b/src/Standards/Typo3Update/AbstractYamlRemovedUsage.php @@ -29,7 +29,7 @@ use Typo3Update\RemovedByYamlConfiguration; abstract class AbstractYamlRemovedUsage { /** - * @var array + * @var RemovedByYamlConfiguration */ protected $configured; @@ -65,19 +65,19 @@ abstract class AbstractYamlRemovedUsage /** * @param PhpCsFile $phpcsFile * @param int $stackPtr - * @param array $removed + * @param array $config */ - protected function addWarning(PhpCsFile $phpcsFile, $stackPtr, array $removed) + protected function addWarning(PhpCsFile $phpcsFile, $stackPtr, array $config) { $phpcsFile->addWarning( 'Calls to removed code are not allowed; found %s. Removed in %s. %s. See: %s', $stackPtr, - $removed['identifier'], + $config['identifier'], [ - $removed['oldUsage'], - $removed['versionRemoved'], - $this->getReplacement($removed), - $removed['docsUrl'], + $config['oldUsage'], + $config['versionRemoved'], + $this->getReplacement($config), + $config['docsUrl'], ] ); } diff --git a/src/Standards/Typo3Update/Feature/FeatureInterface.php b/src/Standards/Typo3Update/Feature/FeatureInterface.php index ac8b7a9..8ab83a7 100644 --- a/src/Standards/Typo3Update/Feature/FeatureInterface.php +++ b/src/Standards/Typo3Update/Feature/FeatureInterface.php @@ -28,11 +28,6 @@ use PHP_CodeSniffer_Sniff as PhpCsSniff; */ interface FeatureInterface { - /** - * @var PhpCsSniff $sniff - */ - public function __construct(PhpCsSniff $sniff); - /** * Process like a PHPCS Sniff. * diff --git a/src/Standards/Typo3Update/Feature/RemovedClassFeature.php b/src/Standards/Typo3Update/Feature/RemovedClassFeature.php index ffc61df..5584dfc 100644 --- a/src/Standards/Typo3Update/Feature/RemovedClassFeature.php +++ b/src/Standards/Typo3Update/Feature/RemovedClassFeature.php @@ -27,7 +27,7 @@ class RemovedClassFeature extends AbstractYamlRemovedUsage { public function process(PhpCsFile $phpcsFile, $classnamePosition, $classname) { - if (! $this->configured->isRemoved($classname)) { + if ($this->configured->isRemoved($classname) === false) { return; } $this->addWarning( diff --git a/src/Standards/Typo3Update/RemovedByYamlConfiguration.php b/src/Standards/Typo3Update/RemovedByYamlConfiguration.php index f1596a9..046c180 100644 --- a/src/Standards/Typo3Update/RemovedByYamlConfiguration.php +++ b/src/Standards/Typo3Update/RemovedByYamlConfiguration.php @@ -33,7 +33,7 @@ class RemovedByYamlConfiguration /** * @param array $configFiles - * @param Callable $prepareStructure + * @param \Callable $prepareStructure */ public function __construct(array $configFiles, $prepareStructure) {