1 | <?php |
||
22 | class SiteProcess extends ProcessBase |
||
23 | { |
||
24 | /** @var AliasRecord */ |
||
25 | protected $siteAlias; |
||
26 | /** @var string[] */ |
||
27 | protected $args; |
||
28 | /** @var string[] */ |
||
29 | protected $options; |
||
30 | /** @var string[] */ |
||
31 | protected $optionsPassedAsArgs; |
||
32 | /** @var string */ |
||
33 | protected $cd; |
||
34 | /** @var TransportInterface */ |
||
35 | protected $transport; |
||
36 | |||
37 | /** |
||
38 | * Process arguments and options per the site alias and build the |
||
39 | * actual command to run. |
||
40 | */ |
||
41 | public function __construct(AliasRecord $siteAlias, TransportInterface $transport, $args, $options = [], $optionsPassedAsArgs = []) |
||
51 | |||
52 | /** |
||
53 | * @inheritdoc |
||
54 | */ |
||
55 | public function setWorkingDirectory($cwd) |
||
60 | |||
61 | public function chdirToSiteRoot($shouldUseSiteRoot = true) |
||
69 | |||
70 | /** |
||
71 | * Take all of our individual arguments and process them for use. |
||
72 | */ |
||
73 | protected function processArgs() |
||
98 | |||
99 | public function setTransport($transport) |
||
103 | |||
104 | /** |
||
105 | * Ask the transport manager for the correct transport for the |
||
106 | * provided alias. |
||
107 | */ |
||
108 | protected function getTransport(AliasRecord $siteAlias) |
||
112 | |||
113 | /** |
||
114 | * @inheritDoc |
||
115 | */ |
||
116 | public function getCommandLine() |
||
127 | |||
128 | /** |
||
129 | * @inheritDoc |
||
130 | */ |
||
131 | public function start(callable $callback = null, $env = array()) |
||
132 | { |
||
133 | $cmd = $this->getCommandLine(); |
||
134 | parent::start($callback, $env); |
||
135 | } |
||
136 | |||
137 | /** |
||
138 | * @inheritDoc |
||
139 | */ |
||
140 | public function wait(callable $callback = null) |
||
145 | |||
146 | /** |
||
147 | * interpolate examines each of the arguments in the provided argument list |
||
148 | * and replaces any token found therein with the value for that key as |
||
149 | * pulled from the given site alias. |
||
150 | * |
||
151 | * Example: "git -C {{root}} status" |
||
152 | * |
||
153 | * The token "{{root}}" will be converted to a value via $siteAlias->get('root'). |
||
154 | * The result will replace the token. |
||
155 | * |
||
156 | * It is possible to use dot notation in the keys to access nested elements |
||
157 | * within the site alias record. |
||
158 | * |
||
159 | * @param AliasRecord $siteAlias |
||
160 | * @param type $args |
||
161 | * @return type |
||
162 | */ |
||
163 | protected function interpolate($args) |
||
176 | } |
||
177 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.