1 | <?php |
||
16 | class ProcessBuilderFactory implements ProcessBuilderFactoryInterface |
||
17 | { |
||
18 | /** |
||
19 | * The binary path |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $binary; |
||
24 | |||
25 | /** |
||
26 | * Constructor |
||
27 | * |
||
28 | * @param string $binary The path to the binary |
||
29 | * |
||
30 | * @throws InvalidArgumentException In case binary path is invalid |
||
31 | */ |
||
32 | public function __construct($binary) |
||
36 | |||
37 | /** |
||
38 | * @inheritdoc |
||
39 | */ |
||
40 | public function getBinary() |
||
44 | |||
45 | /** |
||
46 | * @inheritdoc |
||
47 | */ |
||
48 | public function useBinary($binary) |
||
49 | { |
||
50 | if ('\\' !== DIRECTORY_SEPARATOR && !is_executable($binary)) { |
||
51 | throw new InvalidArgumentException(sprintf('`%s` is not an executable binary', $binary)); |
||
52 | } |
||
53 | |||
54 | $this->binary = $binary; |
||
55 | |||
56 | return $this; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @inheritdoc |
||
61 | */ |
||
62 | public function create() |
||
70 | } |
||
71 |