| Total Complexity | 4 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | class ProcessBuilder implements ProcessBuilderInterface |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var array |
||
| 26 | */ |
||
| 27 | private $arguments; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var int |
||
| 31 | */ |
||
| 32 | private $timeout; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | private $path; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * ProcessBuilder constructor. |
||
| 41 | * |
||
| 42 | * @param string $prefix |
||
| 43 | * @param string $path |
||
| 44 | */ |
||
| 45 | public function __construct(string $prefix, string $path) |
||
| 46 | { |
||
| 47 | $this->arguments = [$prefix]; |
||
| 48 | $this->path = $path; |
||
| 49 | $this->timeout = 900; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param array $arguments arguments for process generation |
||
| 54 | * @return ProcessBuilderInterface |
||
| 55 | */ |
||
| 56 | public function setArguments(array $arguments): ProcessBuilderInterface |
||
| 57 | { |
||
| 58 | $this->arguments = $arguments; |
||
| 59 | |||
| 60 | return $this; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @param int $timeout |
||
| 65 | * @return ProcessBuilderInterface |
||
| 66 | */ |
||
| 67 | public function setTimeout(int $timeout): ProcessBuilderInterface |
||
| 68 | { |
||
| 69 | $this->timeout = $timeout; |
||
| 70 | |||
| 71 | return $this; |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @return Process |
||
| 76 | */ |
||
| 77 | public function getProcess(): Process |
||
| 85 | } |
||
| 86 | } |
||
| 87 |