| Total Complexity | 6 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | abstract class ChurnProcess |
||
| 12 | { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The file the process will be executed on. |
||
| 16 | * |
||
| 17 | * @var File |
||
| 18 | */ |
||
| 19 | protected $file; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The Symfony Process Component. |
||
| 23 | * |
||
| 24 | * @var Process |
||
| 25 | */ |
||
| 26 | protected $process; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Class constructor. |
||
| 30 | * |
||
| 31 | * @param File $file The file the process is being executed on. |
||
| 32 | * @param Process $process The process being executed on the file. |
||
| 33 | */ |
||
| 34 | public function __construct(File $file, Process $process) |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Start the process. |
||
| 42 | */ |
||
| 43 | public function start(): void |
||
| 44 | { |
||
| 45 | $this->process->start(); |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Determines if the process was successful. |
||
| 50 | * |
||
| 51 | * @throws ProcessFailedException If the process failed. |
||
| 52 | */ |
||
| 53 | public function isSuccessful(): bool |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Gets the file the process is being executed on. |
||
| 66 | */ |
||
| 67 | public function getFile(): File |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Gets the output of the process. |
||
| 74 | */ |
||
| 75 | protected function getOutput(): string |
||
| 80 |