Commit 086f4859 authored by Marco Boretto's avatar Marco Boretto

Merge pull request #97 from noplanman/some_code_cleanup

Just inherit repeating documentation blocks
parents 8509c63c 6135853c
...@@ -20,47 +20,16 @@ use Longman\TelegramBot\Request; ...@@ -20,47 +20,16 @@ use Longman\TelegramBot\Request;
*/ */
class ChatsCommand extends Command class ChatsCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'chats'; protected $name = 'chats';
/**
* Description
*
* @var string
*/
protected $description = 'List all chats stored by the bot'; protected $description = 'List all chats stored by the bot';
/**
* Usage
*
* @var string
*/
protected $usage = '/chats'; protected $usage = '/chats';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**
* If this command is public
*
* @var boolean
*/
protected $public = true; protected $public = true;
/**
* If this command needs mysql
*
* @var boolean
*/
protected $need_mysql = false; protected $need_mysql = false;
/**#@-*/
/** /**
* Execution if MySQL is required but not available * Execution if MySQL is required but not available
......
...@@ -18,47 +18,16 @@ use Longman\TelegramBot\Request; ...@@ -18,47 +18,16 @@ use Longman\TelegramBot\Request;
*/ */
class SendtoallCommand extends Command class SendtoallCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'sendtoall'; protected $name = 'sendtoall';
/**
* Description
*
* @var string
*/
protected $description = 'Send the message to all the user\'s bot'; protected $description = 'Send the message to all the user\'s bot';
/**
* Usage
*
* @var string
*/
protected $usage = '/sendall <message to send>'; protected $usage = '/sendall <message to send>';
/**
* Version
*
* @var string
*/
protected $version = '1.2.0'; protected $version = '1.2.0';
/**
* If this command is public
*
* @var boolean
*/
protected $public = true; protected $public = true;
/**
* If this command needs mysql
*
* @var boolean
*/
protected $need_mysql = true; protected $need_mysql = true;
/**#@-*/
/** /**
* Execution if MySQL is required but not available * Execution if MySQL is required but not available
......
...@@ -18,47 +18,16 @@ use Longman\TelegramBot\Request; ...@@ -18,47 +18,16 @@ use Longman\TelegramBot\Request;
*/ */
class SendtochannelCommand extends Command class SendtochannelCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'sendtochannel'; protected $name = 'sendtochannel';
/**
* Description
*
* @var string
*/
protected $description = 'Send message to a channel'; protected $description = 'Send message to a channel';
/**
* Usage
*
* @var string
*/
protected $usage = '/sendchannel <message to send>'; protected $usage = '/sendchannel <message to send>';
/**
* Version
*
* @var string
*/
protected $version = '0.1.0'; protected $version = '0.1.0';
/**
* If this command is public
*
* @var boolean
*/
protected $public = true; protected $public = true;
/**
* If this command needs mysql
*
* @var boolean
*/
protected $need_mysql = false; protected $need_mysql = false;
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command; ...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command;
*/ */
class ChannelchatcreatedCommand extends Command class ChannelchatcreatedCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'Channelchatcreated'; protected $name = 'Channelchatcreated';
/**
* Description
*
* @var string
*/
protected $description = 'Channel chat created'; protected $description = 'Channel chat created';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command; ...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command;
*/ */
class ChoseninlineresultCommand extends Command class ChoseninlineresultCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'choseninlineresult'; protected $name = 'choseninlineresult';
/**
* Description
*
* @var string
*/
protected $description = 'Chosen result query'; protected $description = 'Chosen result query';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -19,40 +19,15 @@ use Longman\TelegramBot\Request; ...@@ -19,40 +19,15 @@ use Longman\TelegramBot\Request;
*/ */
class DateCommand extends Command class DateCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'date'; protected $name = 'date';
/**
* Description
*
* @var string
*/
protected $description = 'Show date/time by location'; protected $description = 'Show date/time by location';
/**
* Usage
*
* @var string
*/
protected $usage = '/date <location>'; protected $usage = '/date <location>';
/**
* Version
*
* @var string
*/
protected $version = '1.2.0'; protected $version = '1.2.0';
/**
* If this command is public
*
* @var boolean
*/
protected $public = true; protected $public = true;
/**#@-*/
/** /**
* Base URL for Google Maps API * Base URL for Google Maps API
......
...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command; ...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command;
*/ */
class DeletechatphotoCommand extends Command class DeletechatphotoCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'Deletechatphoto'; protected $name = 'Deletechatphoto';
/**
* Description
*
* @var string
*/
protected $description = 'Delete chat photo'; protected $description = 'Delete chat photo';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -18,40 +18,15 @@ use Longman\TelegramBot\Request; ...@@ -18,40 +18,15 @@ use Longman\TelegramBot\Request;
*/ */
class EchoCommand extends Command class EchoCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'echo'; protected $name = 'echo';
/**
* Description
*
* @var string
*/
protected $description = 'Show text'; protected $description = 'Show text';
/**
* Usage
*
* @var string
*/
protected $usage = '/echo <text>'; protected $usage = '/echo <text>';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**
* If this command is public
*
* @var boolean
*/
protected $public = true; protected $public = true;
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -18,26 +18,13 @@ use Longman\TelegramBot\Request; ...@@ -18,26 +18,13 @@ use Longman\TelegramBot\Request;
*/ */
class GenericCommand extends Command class GenericCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'Generic'; protected $name = 'Generic';
/**
* Description
*
* @var string
*/
protected $description = 'Handles generic commands or is executed by default when a command is not found'; protected $description = 'Handles generic commands or is executed by default when a command is not found';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command; ...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command;
*/ */
class GenericmessageCommand extends Command class GenericmessageCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'Genericmessage'; protected $name = 'Genericmessage';
/**
* Description
*
* @var string
*/
protected $description = 'Handle generic message'; protected $description = 'Handle generic message';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command; ...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command;
*/ */
class GroupchatcreatedCommand extends Command class GroupchatcreatedCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'Groupchatcreated'; protected $name = 'Groupchatcreated';
/**
* Description
*
* @var string
*/
protected $description = 'Group chat created'; protected $description = 'Group chat created';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -18,40 +18,15 @@ use Longman\TelegramBot\Request; ...@@ -18,40 +18,15 @@ use Longman\TelegramBot\Request;
*/ */
class HelpCommand extends Command class HelpCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'help'; protected $name = 'help';
/**
* Description
*
* @var string
*/
protected $description = 'Show bot commands help'; protected $description = 'Show bot commands help';
/**
* Usage
*
* @var string
*/
protected $usage = '/help or /help <command>'; protected $usage = '/help or /help <command>';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**
* If this command is public
*
* @var boolean
*/
protected $public = true; protected $public = true;
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -19,26 +19,13 @@ use Longman\TelegramBot\Request; ...@@ -19,26 +19,13 @@ use Longman\TelegramBot\Request;
*/ */
class InlinequeryCommand extends Command class InlinequeryCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'inlinequery'; protected $name = 'inlinequery';
/**
* Description
*
* @var string
*/
protected $description = 'Reply to inline query'; protected $description = 'Reply to inline query';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command; ...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command;
*/ */
class LeftchatparticipantCommand extends Command class LeftchatparticipantCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'leftchatparticipant'; protected $name = 'leftchatparticipant';
/**
* Description
*
* @var string
*/
protected $description = 'Left Chat Participant'; protected $description = 'Left Chat Participant';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -18,26 +18,13 @@ use Longman\TelegramBot\Request; ...@@ -18,26 +18,13 @@ use Longman\TelegramBot\Request;
*/ */
class NewchatparticipantCommand extends Command class NewchatparticipantCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'Newchatparticipant'; protected $name = 'Newchatparticipant';
/**
* Description
*
* @var string
*/
protected $description = 'New Chat Participant'; protected $description = 'New Chat Participant';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command; ...@@ -17,26 +17,13 @@ use Longman\TelegramBot\Command;
*/ */
class NewchattitleCommand extends Command class NewchattitleCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'Newchattitle'; protected $name = 'Newchattitle';
/**
* Description
*
* @var string
*/
protected $description = 'New chat Title'; protected $description = 'New chat Title';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -18,33 +18,14 @@ use Longman\TelegramBot\Request; ...@@ -18,33 +18,14 @@ use Longman\TelegramBot\Request;
*/ */
class SlapCommand extends Command class SlapCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'slap'; protected $name = 'slap';
/**
* Description
*
* @var string
*/
protected $description = 'Slap someone with their username'; protected $description = 'Slap someone with their username';
/**
* Usage
*
* @var string
*/
protected $usage = '/slap <@user>'; protected $usage = '/slap <@user>';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -18,33 +18,14 @@ use Longman\TelegramBot\Request; ...@@ -18,33 +18,14 @@ use Longman\TelegramBot\Request;
*/ */
class StartCommand extends Command class StartCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'start'; protected $name = 'start';
/**
* Description
*
* @var string
*/
protected $description = 'Start command'; protected $description = 'Start command';
/**
* Usage
*
* @var string
*/
protected $usage = '/'; protected $usage = '/';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -18,26 +18,13 @@ use Longman\TelegramBot\Request; ...@@ -18,26 +18,13 @@ use Longman\TelegramBot\Request;
*/ */
class SupergroupchatcreatedCommand extends Command class SupergroupchatcreatedCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'Supergroupchatcreated'; protected $name = 'Supergroupchatcreated';
/**
* Description
*
* @var string
*/
protected $description = 'Super group chat created'; protected $description = 'Super group chat created';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**#@-*/
/** /**
* Execute command * Execute command
......
...@@ -18,40 +18,15 @@ use Longman\TelegramBot\Request; ...@@ -18,40 +18,15 @@ use Longman\TelegramBot\Request;
*/ */
class WeatherCommand extends Command class WeatherCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'weather'; protected $name = 'weather';
/**
* Description
*
* @var string
*/
protected $description = 'Show weather by location'; protected $description = 'Show weather by location';
/**
* Usage
*
* @var string
*/
protected $usage = '/weather <location>'; protected $usage = '/weather <location>';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**
* If this command is public
*
* @var boolean
*/
protected $public = true; protected $public = true;
/**#@-*/
/** /**
* Get weather using cURL request * Get weather using cURL request
......
...@@ -21,40 +21,15 @@ use Longman\TelegramBot\Request; ...@@ -21,40 +21,15 @@ use Longman\TelegramBot\Request;
*/ */
class WhoamiCommand extends Command class WhoamiCommand extends Command
{ {
/** /**#@+
* Name * {@inheritdoc}
*
* @var string
*/ */
protected $name = 'whoami'; protected $name = 'whoami';
/**
* Description
*
* @var string
*/
protected $description = 'Show your id, name and username'; protected $description = 'Show your id, name and username';
/**
* Usage
*
* @var string
*/
protected $usage = '/whoami'; protected $usage = '/whoami';
/**
* Version
*
* @var string
*/
protected $version = '1.0.0'; protected $version = '1.0.0';
/**
* If this command is public
*
* @var boolean
*/
protected $public = true; protected $public = true;
/**#@-*/
/** /**
* Execute command * Execute command
......
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