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) |
||
87 | |||
88 | /** |
||
89 | * Get the starting directory for the initial/local process. |
||
90 | * |
||
91 | * @return string|null; |
||
92 | */ |
||
93 | public function getWorkingDirectoryLocal() |
||
97 | |||
98 | /** |
||
99 | * |
||
100 | * @param bool $shouldUseSiteRoot |
||
101 | * @return $this|\Symfony\Component\Process\Process |
||
102 | * @throws \Exception |
||
103 | */ |
||
104 | public function chdirToSiteRoot($shouldUseSiteRoot = true) |
||
112 | |||
113 | /** |
||
114 | * Take all of our individual arguments and process them for use. |
||
115 | */ |
||
116 | protected function processArgs() |
||
146 | |||
147 | /** |
||
148 | * Wrap the command/args in an env call. |
||
149 | * @todo Check if this needs to depend on linux/win. |
||
150 | * @todo Check if this needs to be delegated to transport. |
||
151 | */ |
||
152 | public function addEnvVars($envVars, $args) |
||
161 | |||
162 | public function setTransport($transport) |
||
166 | |||
167 | /** |
||
168 | * Ask the transport manager for the correct transport for the |
||
169 | * provided alias. |
||
170 | */ |
||
171 | protected function getTransport(SiteAliasInterface $siteAlias) |
||
175 | |||
176 | /** |
||
177 | * @inheritDoc |
||
178 | */ |
||
179 | public function getCommandLine() |
||
190 | |||
191 | /** |
||
192 | * @inheritDoc |
||
193 | */ |
||
194 | public function start(callable $callback = null, $env = array()) |
||
199 | |||
200 | /** |
||
201 | * @inheritDoc |
||
202 | */ |
||
203 | public function wait(callable $callback = null) |
||
208 | |||
209 | /** |
||
210 | * interpolate examines each of the arguments in the provided argument list |
||
211 | * and replaces any token found therein with the value for that key as |
||
212 | * pulled from the given site alias. |
||
213 | * |
||
214 | * Example: "git -C {{root}} status" |
||
215 | * |
||
216 | * The token "{{root}}" will be converted to a value via $siteAlias->get('root'). |
||
217 | * The result will replace the token. |
||
218 | * |
||
219 | * It is possible to use dot notation in the keys to access nested elements |
||
220 | * within the site alias record. |
||
221 | * |
||
222 | * @param SiteAliasInterface $siteAlias |
||
223 | * @param type $args |
||
224 | * @return type |
||
225 | */ |
||
226 | protected function interpolate($args) |
||
239 | } |
||
240 |
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.