Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
2c8cf263
Commit
2c8cf263
authored
Feb 18, 2016
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear out abstract class constructors that aren't needed.
Move start command to the system commands.
parent
c9149845
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
32 deletions
+14
-32
AbstractAdminCommand.php
src/Commands/Admin/AbstractAdminCommand.php
+1
-11
AbstractSystemCommand.php
src/Commands/System/AbstractSystemCommand.php
+8
-6
StartCommand.php
src/Commands/System/StartCommand.php
+4
-4
AbstractUserCommand.php
src/Commands/User/AbstractUserCommand.php
+1
-11
No files found.
src/Commands/Admin/AbstractAdminCommand.php
View file @
2c8cf263
...
...
@@ -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
);
}
}
src/Commands/System/AbstractSystemCommand.php
View file @
2c8cf263
...
...
@@ -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
;
}
}
src/Commands/
User
/StartCommand.php
→
src/Commands/
System
/StartCommand.php
View file @
2c8cf263
...
...
@@ -8,22 +8,22 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands\
User
Commands
;
namespace
Longman\TelegramBot\Commands\
System
Commands
;
use
Longman\TelegramBot\Commands\
User
Command
;
use
Longman\TelegramBot\Commands\
System
Command
;
use
Longman\TelegramBot\Request
;
/**
* Start command
*/
class
StartCommand
extends
User
Command
class
StartCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
*/
protected
$name
=
'start'
;
protected
$description
=
'Start command'
;
protected
$usage
=
'/'
;
protected
$usage
=
'/
start
'
;
protected
$version
=
'1.0.1'
;
/**#@-*/
...
...
src/Commands/User/AbstractUserCommand.php
View file @
2c8cf263
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment