php-shell/lib/Command.php

39 lines
576 B
PHP
Raw 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);
}
abstract public function getName();
public function getDescription()
{}
public function getHelp()
{}
public function run(array $args)
{
call_user_func_array([$this,"execute"], $args);
}
}