1 | <?php |
||
18 | class ProcessFactory implements IProcessFactory |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Creates new Symfony process with given arguments. |
||
23 | * |
||
24 | * @param string $commandline The command line to run. |
||
25 | * @param integer|null $idle_timeout Idle timeout. |
||
26 | * |
||
27 | * @return Process |
||
28 | */ |
||
29 | 1 | public function createProcess( |
|
39 | |||
40 | /** |
||
41 | * Creates new Symfony PHP process with given arguments. |
||
42 | * |
||
43 | * @param string $command Command. |
||
44 | * @param array $arguments Arguments. |
||
45 | * |
||
46 | * @return Process |
||
47 | * @throws \RuntimeException When PHP executable can't be found. |
||
48 | */ |
||
49 | public function createCommandProcess($command, array $arguments = array()) |
||
62 | |||
63 | } |
||
64 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: