Commit 2c8cf263 authored by Armando Lüscher's avatar Armando Lüscher

Clear out abstract class constructors that aren't needed.

Move start command to the system commands.
parent c9149845
......@@ -10,20 +10,10 @@
namespace Longman\TelegramBot\Commands;
use Longman\TelegramBot\Telegram;
/**
* Abstract Admin Command Class
*/
abstract class AdminCommand extends Command
{
/**
* Constructor
*
* @param Telegram $telegram
*/
public function __construct(Telegram $telegram)
{
parent::__construct($telegram);
}
}
......@@ -10,20 +10,22 @@
namespace Longman\TelegramBot\Commands;
use Longman\TelegramBot\Telegram;
/**
* Abstract System Command Class
*/
abstract class SystemCommand extends Command
{
/**
* Constructor
* A system command just executes
*
* Although system commands should just work and return 'true',
* each system command can override this method to add custom functionality.
*
* @param Telegram $telegram
* @return bool
*/
public function __construct(Telegram $telegram)
public function execute()
{
parent::__construct($telegram);
//System command, do nothing
return true;
}
}
......@@ -8,22 +8,22 @@
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Commands\UserCommands;
namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Request;
/**
* Start command
*/
class StartCommand extends UserCommand
class StartCommand extends SystemCommand
{
/**#@+
* {@inheritdoc}
*/
protected $name = 'start';
protected $description = 'Start command';
protected $usage = '/';
protected $usage = '/start';
protected $version = '1.0.1';
/**#@-*/
......
......@@ -10,20 +10,10 @@
namespace Longman\TelegramBot\Commands;
use Longman\TelegramBot\Telegram;
/**
* Abstract User Command Class
*/
abstract class UserCommand extends Command
{
/**
* Constructor
*
* @param Telegram $telegram
*/
public function __construct(Telegram $telegram)
{
parent::__construct($telegram);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment