[YamlRector] Apply array param autowire

This commit is contained in:
Tomas Votruba 2018-10-06 12:34:16 +08:00
parent 318f5b30f8
commit ca574d7cab
2 changed files with 5 additions and 9 deletions

View File

@ -12,9 +12,12 @@ final class YamlFileProcessor
*/
private $yamlRectors = [];
public function addYamlRector(YamlRectorInterface $yamlRector): void
/**
* @param YamlRectorInterface[] $yamlRectors
*/
public function __construct(array $yamlRectors = [])
{
$this->yamlRectors[] = $yamlRector;
$this->yamlRectors = $yamlRectors;
}
/**

View File

@ -1,9 +1,2 @@
imports:
- { resource: 'services.yml' }
parameters:
collectors:
-
main_type: 'Rector\YamlRector\YamlFileProcessor'
collected_type: 'Rector\YamlRector\Contract\YamlRectorInterface'
add_method: 'addYamlRector'