php-shell/lib/Command.php

40 lines
572 B
PHP

<?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);
}
public function getName()
{}
public function getDescription()
{}
public function getHelp()
{}
public function __invoke(...$args)
{
call_user_func([$this,"execute"], ...$args);
}
}