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:
parent
11db09a303
commit
9e3f7ac1e5
4 changed files with 10 additions and 15 deletions
|
@ -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'],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -33,7 +33,7 @@ class RemovedByYamlConfiguration
|
|||
|
||||
/**
|
||||
* @param array $configFiles
|
||||
* @param Callable $prepareStructure
|
||||
* @param \Callable $prepareStructure
|
||||
*/
|
||||
public function __construct(array $configFiles, $prepareStructure)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue