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
This commit is contained in:
Daniel Siepmann 2017-05-02 08:09:10 +02:00
parent 11db09a303
commit 9e3f7ac1e5
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
4 changed files with 10 additions and 15 deletions

View file

@ -29,7 +29,7 @@ use Typo3Update\RemovedByYamlConfiguration;
abstract class AbstractYamlRemovedUsage abstract class AbstractYamlRemovedUsage
{ {
/** /**
* @var array * @var RemovedByYamlConfiguration
*/ */
protected $configured; protected $configured;
@ -65,19 +65,19 @@ abstract class AbstractYamlRemovedUsage
/** /**
* @param PhpCsFile $phpcsFile * @param PhpCsFile $phpcsFile
* @param int $stackPtr * @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( $phpcsFile->addWarning(
'Calls to removed code are not allowed; found %s. Removed in %s. %s. See: %s', 'Calls to removed code are not allowed; found %s. Removed in %s. %s. See: %s',
$stackPtr, $stackPtr,
$removed['identifier'], $config['identifier'],
[ [
$removed['oldUsage'], $config['oldUsage'],
$removed['versionRemoved'], $config['versionRemoved'],
$this->getReplacement($removed), $this->getReplacement($config),
$removed['docsUrl'], $config['docsUrl'],
] ]
); );
} }

View file

@ -28,11 +28,6 @@ use PHP_CodeSniffer_Sniff as PhpCsSniff;
*/ */
interface FeatureInterface interface FeatureInterface
{ {
/**
* @var PhpCsSniff $sniff
*/
public function __construct(PhpCsSniff $sniff);
/** /**
* Process like a PHPCS Sniff. * Process like a PHPCS Sniff.
* *

View file

@ -27,7 +27,7 @@ class RemovedClassFeature extends AbstractYamlRemovedUsage
{ {
public function process(PhpCsFile $phpcsFile, $classnamePosition, $classname) public function process(PhpCsFile $phpcsFile, $classnamePosition, $classname)
{ {
if (! $this->configured->isRemoved($classname)) { if ($this->configured->isRemoved($classname) === false) {
return; return;
} }
$this->addWarning( $this->addWarning(

View file

@ -33,7 +33,7 @@ class RemovedByYamlConfiguration
/** /**
* @param array $configFiles * @param array $configFiles
* @param Callable $prepareStructure * @param \Callable $prepareStructure
*/ */
public function __construct(array $configFiles, $prepareStructure) public function __construct(array $configFiles, $prepareStructure)
{ {