| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | abstract class AbstractDatabaseCommand extends AbstractLockedCommand |
||
| 15 | { |
||
| 16 | private ProcessHelper $processHelper; |
||
| 17 | private string $phpBinary; |
||
| 18 | |||
| 19 | 5 | public function __construct(LockFactory $locker, ProcessHelper $processHelper, PhpExecutableFinder $phpFinder) |
|
| 20 | { |
||
| 21 | 5 | parent::__construct($locker); |
|
| 22 | 5 | $this->processHelper = $processHelper; |
|
| 23 | 5 | $this->phpBinary = $phpFinder->find(false) ?: 'php'; |
|
| 24 | 5 | } |
|
| 25 | |||
| 26 | 2 | protected function runPhpCommand(OutputInterface $output, array $command): void |
|
| 27 | { |
||
| 28 | 2 | $command = [$this->phpBinary, ...$command, '--no-interaction']; |
|
| 29 | 2 | $this->processHelper->mustRun($output, $command); |
|
|
|
|||
| 30 | 2 | } |
|
| 31 | |||
| 32 | 5 | protected function getLockConfig(): LockedCommandConfig |
|
| 35 | } |
||
| 36 | } |
||
| 37 |