| Total Complexity | 9 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class BaseCommand extends Command |
||
| 12 | { |
||
| 13 | protected $appContainer; |
||
| 14 | |||
| 15 | protected $jobs = []; |
||
| 16 | |||
| 17 | protected $processors = []; |
||
| 18 | |||
| 19 | /** @var ReplaceText */ |
||
| 20 | protected $replaceTextJob; |
||
| 21 | |||
| 22 | public function __construct(AppContainer $appContainer) |
||
| 23 | { |
||
| 24 | $this->appContainer = $appContainer; |
||
| 25 | $this->replaceTextJob = $this->appContainer->resolve(ReplaceText::class); |
||
| 26 | |||
| 27 | parent::__construct(); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function setJobs() |
||
| 31 | { |
||
| 32 | foreach ($this->jobs as $key => $job) { |
||
| 33 | $this->jobs[$key] = $this->appContainer->resolve($key); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | public function setProcessors() |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | public function runProcessors(InputInterface $input, OutputInterface $output) |
||
| 45 | { |
||
| 46 | foreach ($this->processors as $processor) { |
||
| 47 | $processor($input, $output); |
||
| 48 | } |
||
| 49 | |||
| 50 | return $this; |
||
| 51 | } |
||
| 52 | |||
| 53 | public function replaceTextsSequence(array $sequence, string $destination) |
||
| 60 | } |
||
| 61 | } |
||
| 62 |