1 | <?php |
||
14 | class Executor |
||
15 | { |
||
16 | /** |
||
17 | * Constructor |
||
18 | * |
||
19 | * @param Container $container |
||
20 | */ |
||
21 | 8 | public function __construct(Container $container) |
|
22 | { |
||
23 | 8 | $this->container = $container; |
|
|
|||
24 | 8 | } |
|
25 | |||
26 | |||
27 | /** |
||
28 | * Executes the passed command line in the shell. |
||
29 | * |
||
30 | * @param string $cmd |
||
31 | * @param null &$captureOutput |
||
32 | * @param string $captureOutput |
||
33 | * @return int |
||
34 | * |
||
35 | * @throws ExecutionAbortedException |
||
36 | * @throws \UnexpectedValueException |
||
37 | */ |
||
38 | public function execute($cmd, &$captureOutput = null) |
||
68 | |||
69 | |||
70 | /** |
||
71 | * Create the process instance to use for non-interactive handling |
||
72 | * |
||
73 | * @var bool $interactive |
||
74 | * @return \Symfony\Component\Process\Process |
||
75 | */ |
||
76 | protected function createProcess($interactive = false) |
||
90 | |||
91 | |||
92 | /** |
||
93 | * The callback used for the process executed by Process |
||
94 | * |
||
95 | * @param mixed $mode |
||
96 | * @param string $data |
||
97 | * @return void |
||
98 | */ |
||
99 | public function processCallback($mode, $data) |
||
105 | } |
||
106 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: