php-shell/lib/Command.php

40 lines
572 B
PHP
Raw Permalink Normal View History

2016-04-25 18:47:30 +00:00
<?php
namespace NoccyLabs\Shell;
use NoccyLabs\Shell\LineRead;
abstract class Command
{
protected $name;
protected $deescription;
protected $shell;
public function setShell(Shell $shell)
{
$this->shell = $shell;
}
protected function writeln($str)
{
$this->shell->writeln($str);
}
2016-11-01 14:12:11 +00:00
public function getName()
{}
2016-04-25 18:47:30 +00:00
public function getDescription()
{}
public function getHelp()
{}
2016-11-01 14:12:11 +00:00
public function __invoke(...$args)
2016-04-25 18:47:30 +00:00
{
2016-11-01 14:12:11 +00:00
call_user_func([$this,"execute"], ...$args);
2016-04-25 18:47:30 +00:00
}
}