| @@ 189-199 (lines=11) @@ | ||
| 186 | * @param ConsoleInterface |
|
| 187 | * @return mixed |
|
| 188 | */ |
|
| 189 | public function console(ConsoleInterface $value = null) |
|
| 190 | { |
|
| 191 | if (null === $value) { |
|
| 192 | return $this->console; |
|
| 193 | } |
|
| 194 | $this->console = $value; |
|
| 195 | foreach ($this->commands as $name => $command) { |
|
| 196 | $command->console = $value; |
|
| 197 | } |
|
| 198 | return $this; |
|
| 199 | } |
|
| 200 | ||
| 201 | /** |
|
| 202 | * fs getter and setter. |
|
| @@ 227-237 (lines=11) @@ | ||
| 224 | * @param Tarsana\Command\Interfaces\Template\TemplateLoaderInterface |
|
| 225 | * @return mixed |
|
| 226 | */ |
|
| 227 | public function templatesLoader(TemplateLoaderInterface $value = null) |
|
| 228 | { |
|
| 229 | if (null === $value) { |
|
| 230 | return $this->templatesLoader; |
|
| 231 | } |
|
| 232 | $this->templatesLoader = $value; |
|
| 233 | foreach ($this->commands as $name => $command) { |
|
| 234 | $command->templatesLoader = $value; |
|
| 235 | } |
|
| 236 | return $this; |
|
| 237 | } |
|
| 238 | ||
| 239 | public function templatesPath(string $path, string $cachePath = null) |
|
| 240 | { |
|
| @@ 239-245 (lines=7) @@ | ||
| 236 | return $this; |
|
| 237 | } |
|
| 238 | ||
| 239 | public function templatesPath(string $path, string $cachePath = null) |
|
| 240 | { |
|
| 241 | $this->templatesLoader = new TemplateLoader($path, $cachePath); |
|
| 242 | foreach ($this->commands as $name => $command) { |
|
| 243 | $command->templatesLoader = $this->templatesLoader(); |
|
| 244 | } |
|
| 245 | return $this; |
|
| 246 | } |
|
| 247 | ||
| 248 | public function template(string $name) |
|
| @@ 291-301 (lines=11) @@ | ||
| 288 | * @param array |
|
| 289 | * @return mixed |
|
| 290 | */ |
|
| 291 | public function commands(array $value = null) |
|
| 292 | { |
|
| 293 | if (null === $value) { |
|
| 294 | return $this->commands; |
|
| 295 | } |
|
| 296 | $this->commands = []; |
|
| 297 | foreach ($value as $name => $command) { |
|
| 298 | $this->command($name, $command); |
|
| 299 | } |
|
| 300 | return $this; |
|
| 301 | } |
|
| 302 | ||
| 303 | public function command(string $name, Command $command = null) |
|
| 304 | { |
|