1 | <?php |
||
23 | class SiteProcess extends ProcessBase |
||
24 | { |
||
25 | /** @var SiteAliasInterface */ |
||
26 | protected $siteAlias; |
||
27 | /** @var string[] */ |
||
28 | protected $args; |
||
29 | /** @var string[] */ |
||
30 | protected $options; |
||
31 | /** @var string[] */ |
||
32 | protected $optionsPassedAsArgs; |
||
33 | /** @var string */ |
||
34 | protected $cd_remote; |
||
35 | /** @var TransportInterface */ |
||
36 | protected $transport; |
||
37 | |||
38 | /** |
||
39 | * Process arguments and options per the site alias and build the |
||
40 | * actual command to run. |
||
41 | */ |
||
42 | public function __construct(SiteAliasInterface $siteAlias, TransportInterface $transport, $args, $options = [], $optionsPassedAsArgs = []) |
||
52 | |||
53 | /** |
||
54 | * Get a starting directory for the remote process. |
||
55 | * |
||
56 | * @return string|null |
||
57 | */ |
||
58 | public function getWorkingDirectory() |
||
62 | |||
63 | /** |
||
64 | * Set a starting directory for the remote process. |
||
65 | * |
||
66 | * @param string $cd_remote |
||
67 | * |
||
68 | * @return \Consolidation\SiteProcess\SiteProcess |
||
69 | */ |
||
70 | public function setWorkingDirectory($cd_remote) |
||
75 | |||
76 | /** |
||
77 | * Set a starting directory for the initial/local process. |
||
78 | * |
||
79 | * @param string $cd |
||
80 | * |
||
81 | * @return \Consolidation\SiteProcess\SiteProcess |
||
82 | */ |
||
83 | public function setWorkingDirectoryLocal($cd) |
||
92 | |||
93 | /** |
||
94 | * Get the starting directory for the initial/local process. |
||
95 | * |
||
96 | * @return string|null; |
||
97 | */ |
||
98 | public function getWorkingDirectoryLocal() |
||
102 | |||
103 | /** |
||
104 | * |
||
105 | * @param bool $shouldUseSiteRoot |
||
106 | * @return $this|\Symfony\Component\Process\Process |
||
107 | * @throws \Exception |
||
108 | */ |
||
109 | public function chdirToSiteRoot($shouldUseSiteRoot = true) |
||
117 | |||
118 | /** |
||
119 | * Take all of our individual arguments and process them for use. |
||
120 | */ |
||
121 | protected function processArgs() |
||
151 | |||
152 | /** |
||
153 | * Wrap the command/args in an env call. |
||
154 | * @todo Check if this needs to depend on linux/win. |
||
155 | * @todo Check if this needs to be delegated to transport. |
||
156 | */ |
||
157 | public function addEnvVars($envVars, $args) |
||
166 | |||
167 | public function setTransport($transport) |
||
171 | |||
172 | /** |
||
173 | * Ask the transport manager for the correct transport for the |
||
174 | * provided alias. |
||
175 | */ |
||
176 | protected function getTransport(SiteAliasInterface $siteAlias) |
||
180 | |||
181 | /** |
||
182 | * @inheritDoc |
||
183 | */ |
||
184 | public function getCommandLine() |
||
195 | |||
196 | /** |
||
197 | * @inheritDoc |
||
198 | */ |
||
199 | public function start(callable $callback = null, array $env = []) |
||
204 | |||
205 | /** |
||
206 | * @inheritDoc |
||
207 | */ |
||
208 | public function wait(callable $callback = null) |
||
213 | |||
214 | /** |
||
215 | * interpolate examines each of the arguments in the provided argument list |
||
216 | * and replaces any token found therein with the value for that key as |
||
217 | * pulled from the given site alias. |
||
218 | * |
||
219 | * Example: "git -C {{root}} status" |
||
220 | * |
||
221 | * The token "{{root}}" will be converted to a value via $siteAlias->get('root'). |
||
222 | * The result will replace the token. |
||
223 | * |
||
224 | * It is possible to use dot notation in the keys to access nested elements |
||
225 | * within the site alias record. |
||
226 | * |
||
227 | * @param SiteAliasInterface $siteAlias |
||
228 | * @param type $args |
||
229 | * @return type |
||
230 | */ |
||
231 | protected function interpolate($args) |
||
244 | } |
||
245 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.