mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 12:14:02 +01:00
fix review
This commit is contained in:
parent
321fbbc364
commit
da3ecf0d64
@ -24,11 +24,6 @@ final class ArgumentAdderRector extends AbstractArgumentRector
|
||||
*/
|
||||
private $activeArgumentAdderRecipes = [];
|
||||
|
||||
/**
|
||||
* @var ArgumentAdderRecipeFactory
|
||||
*/
|
||||
private $argumentAdderRecipeFactory;
|
||||
|
||||
/**
|
||||
* @param mixed[] $argumentChangesByMethodAndType
|
||||
*/
|
||||
@ -36,8 +31,7 @@ final class ArgumentAdderRector extends AbstractArgumentRector
|
||||
array $argumentChangesByMethodAndType,
|
||||
ArgumentAdderRecipeFactory $argumentAdderRecipeFactory
|
||||
) {
|
||||
$this->argumentAdderRecipeFactory = $argumentAdderRecipeFactory;
|
||||
$this->loadArgumentReplacerRecipes($argumentChangesByMethodAndType);
|
||||
$this->loadArgumentReplacerRecipes($argumentAdderRecipeFactory, $argumentChangesByMethodAndType);
|
||||
}
|
||||
|
||||
public function getDefinition(): RectorDefinition
|
||||
@ -98,10 +92,12 @@ $containerBuilder->compile(true);'
|
||||
/**
|
||||
* @param mixed[] $configurationArrays
|
||||
*/
|
||||
private function loadArgumentReplacerRecipes(array $configurationArrays): void
|
||||
{
|
||||
private function loadArgumentReplacerRecipes(
|
||||
ArgumentAdderRecipeFactory $argumentAdderRecipeFactory,
|
||||
array $configurationArrays
|
||||
): void {
|
||||
foreach ($configurationArrays as $configurationArray) {
|
||||
$this->argumentAdderRecipes[] = $this->argumentAdderRecipeFactory->createFromArray($configurationArray);
|
||||
$this->argumentAdderRecipes[] = $argumentAdderRecipeFactory->createFromArray($configurationArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,11 +31,6 @@ final class ArgumentDefaultValueReplacerRector extends AbstractArgumentRector
|
||||
*/
|
||||
private $constExprEvaluator;
|
||||
|
||||
/**
|
||||
* @var ArgumentDefaultValueReplacerRecipeFactory
|
||||
*/
|
||||
private $argumentDefaultValueReplacerRecipeFactory;
|
||||
|
||||
/**
|
||||
* @param mixed[] $argumentChangesByMethodAndType
|
||||
*/
|
||||
@ -44,8 +39,7 @@ final class ArgumentDefaultValueReplacerRector extends AbstractArgumentRector
|
||||
ConstExprEvaluator $constExprEvaluator,
|
||||
ArgumentDefaultValueReplacerRecipeFactory $argumentDefaultValueReplacerRecipeFactory
|
||||
) {
|
||||
$this->argumentDefaultValueReplacerRecipeFactory = $argumentDefaultValueReplacerRecipeFactory;
|
||||
$this->loadArgumentReplacerRecipes($argumentChangesByMethodAndType);
|
||||
$this->loadArgumentReplacerRecipes($argumentDefaultValueReplacerRecipeFactory, $argumentChangesByMethodAndType);
|
||||
$this->constExprEvaluator = $constExprEvaluator;
|
||||
}
|
||||
|
||||
@ -107,10 +101,12 @@ $container->register("foo", "stdClass")->setScope(false);'
|
||||
/**
|
||||
* @param mixed[] $configurationArrays
|
||||
*/
|
||||
private function loadArgumentReplacerRecipes(array $configurationArrays): void
|
||||
{
|
||||
private function loadArgumentReplacerRecipes(
|
||||
ArgumentDefaultValueReplacerRecipeFactory $argumentDefaultValueReplacerRecipeFactory,
|
||||
array $configurationArrays
|
||||
): void {
|
||||
foreach ($configurationArrays as $configurationArray) {
|
||||
$this->argumentDefaultValueReplacerRecipe[] = $this->argumentDefaultValueReplacerRecipeFactory->createFromArray(
|
||||
$this->argumentDefaultValueReplacerRecipe[] = $argumentDefaultValueReplacerRecipeFactory->createFromArray(
|
||||
$configurationArray
|
||||
);
|
||||
}
|
||||
|
@ -23,11 +23,6 @@ final class ArgumentRemoverRector extends AbstractArgumentRector
|
||||
*/
|
||||
private $activeArgumentRemoverRecipes = [];
|
||||
|
||||
/**
|
||||
* @var ArgumentRemoverRecipeFactory
|
||||
*/
|
||||
private $argumentRemoverRecipeFactory;
|
||||
|
||||
/**
|
||||
* @param mixed[] $argumentChangesByMethodAndType
|
||||
*/
|
||||
@ -35,8 +30,7 @@ final class ArgumentRemoverRector extends AbstractArgumentRector
|
||||
array $argumentChangesByMethodAndType,
|
||||
ArgumentRemoverRecipeFactory $argumentRemoverRecipeFactory
|
||||
) {
|
||||
$this->argumentRemoverRecipeFactory = $argumentRemoverRecipeFactory;
|
||||
$this->loadArgumentReplacerRecipes($argumentChangesByMethodAndType);
|
||||
$this->loadArgumentReplacerRecipes($argumentRemoverRecipeFactory, $argumentChangesByMethodAndType);
|
||||
}
|
||||
|
||||
public function getDefinition(): RectorDefinition
|
||||
@ -97,12 +91,12 @@ $containerBuilder->compile();'
|
||||
/**
|
||||
* @param mixed[] $configurationArrays
|
||||
*/
|
||||
private function loadArgumentReplacerRecipes(array $configurationArrays): void
|
||||
{
|
||||
private function loadArgumentReplacerRecipes(
|
||||
ArgumentRemoverRecipeFactory $argumentRemoverRecipeFactory,
|
||||
array $configurationArrays
|
||||
): void {
|
||||
foreach ($configurationArrays as $configurationArray) {
|
||||
$this->argumentRemoverRecipes[] = $this->argumentRemoverRecipeFactory->createFromArray(
|
||||
$configurationArray
|
||||
);
|
||||
$this->argumentRemoverRecipes[] = $argumentRemoverRecipeFactory->createFromArray($configurationArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user