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
9c43213f
Commit
9c43213f
authored
Feb 04, 2016
by
Marco Boretto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #84 from noplanman/further_code_cleanup
Some typo corrections.
parents
970ae10b
1249dfc9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
21 deletions
+20
-21
CONTRIBUTING.md
CONTRIBUTING.md
+7
-7
Command.php
src/Command.php
+3
-4
Telegram.php
src/Telegram.php
+10
-10
No files found.
CONTRIBUTING.md
View file @
9c43213f
...
@@ -22,6 +22,7 @@ If you develop a new feature please create a new branch.
...
@@ -22,6 +22,7 @@ If you develop a new feature please create a new branch.
Version
Version
-------
-------
Version number: 0.#version.#hotfix
Version number: 0.#version.#hotfix
Further code convention adopted
Further code convention adopted
...
@@ -30,7 +31,7 @@ Further code convention adopted
...
@@ -30,7 +31,7 @@ Further code convention adopted
-
Each method and class is documented with a docblock
-
Each method and class is documented with a docblock
-
Each file is provided with the following header:
-
Each file is provided with the following header:
```
```
/*
/*
*
* This file is part of the TelegramBot package.
* This file is part of the TelegramBot package.
*
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
...
@@ -41,10 +42,9 @@ Further code convention adopted
...
@@ -41,10 +42,9 @@ Further code convention adopted
```
```
-
No empty line after class declaration
-
No empty line after class declaration
-
No empty line after
`<?php`
-
No empty line after
`<?php`
-
Last element of a
rray must end with co
ma
-
Last element of a
multi-line array must be followed by a com
ma
-
One empty line after the doc
k
block header
-
One empty line after the docblock header
-
Array
and use statement must be written in alphabetical order
-
Array
elements and
`use`
statements should be written in a logical order, preferrably alphabetically
-
Use
[]
instead of array()
-
Use
[]
instead of array()
-
Use
''
for string
-
Use
single quotes (
`'`
)
for string
-
Leave space in front and behind the concatenation operator
`.`
-
Leave space in front and behind the concatenation operator
`.`
src/Command.php
View file @
9c43213f
...
@@ -15,8 +15,7 @@ use Longman\TelegramBot\Entities\Update;
...
@@ -15,8 +15,7 @@ use Longman\TelegramBot\Entities\Update;
use
Longman\TelegramBot\Entities\User
;
use
Longman\TelegramBot\Entities\User
;
/**
/**
* Class Commad.
* Class Command
*
*/
*/
abstract
class
Command
abstract
class
Command
{
{
...
@@ -180,8 +179,8 @@ abstract class Command
...
@@ -180,8 +179,8 @@ abstract class Command
/**
/**
* Get command config
* Get command config
*
*
* Look for parame
n
ter $name if found return it, if not return null.
* Look for parameter $name if found return it, if not return null.
* If $name is not set return the all
params setted
* If $name is not set return the all
set params
*
*
* @param string|null $name
* @param string|null $name
* @return mixed
* @return mixed
...
...
src/Telegram.php
View file @
9c43213f
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* file that was distributed with this source code.
*/
*/
namespace
Longman\TelegramBot
;
namespace
Longman\TelegramBot
;
define
(
'BASE_PATH'
,
dirname
(
__FILE__
));
define
(
'BASE_PATH'
,
dirname
(
__FILE__
));
...
@@ -61,8 +62,7 @@ class Telegram
...
@@ -61,8 +62,7 @@ class Telegram
/**
/**
* Row custom update (json)
* Row custom update (json)
*
*
* Used to inject a custom update fot testing purpose in the
* Used to inject a custom update for testing purposes in the Request class
* request class
*
*
* @var string
* @var string
*/
*/
...
@@ -376,8 +376,8 @@ class Telegram
...
@@ -376,8 +376,8 @@ class Telegram
/**
/**
* Handle bot request from wekhook
* Handle bot request from wekhook
*
*
* @todo Should return the executed command result (true
,
false) but we shoud check if all commands return a value.
* @todo Should return the executed command result (true
|
false) but we shoud check if all commands return a value.
* Furthermore this function is the tw
een of handleGetUpdates for webhook, but the first return the ServerResponse
* Furthermore this function is the tw
in of handleGetUpdates for webhook, but the first returns the ServerResponse
* instead the latter return if the command has failed or not (true|false).
* instead the latter return if the command has failed or not (true|false).
* We shoud use the same convention for both.
* We shoud use the same convention for both.
*
*
...
@@ -514,11 +514,11 @@ class Telegram
...
@@ -514,11 +514,11 @@ class Telegram
/**
/**
* Get command class
* Get command class
*
*
* @todo check return
*
* @param string $command
* @param string $command
* @param \Longman\TelegramBot\Entities\ServerResponse|null $update
* @param \Longman\TelegramBot\Entities\ServerResponse|null $update
*
*
* @TODO check return
*
* @return object
* @return object
*/
*/
public
function
getCommandClass
(
$command
,
Update
$update
=
null
)
public
function
getCommandClass
(
$command
,
Update
$update
=
null
)
...
...
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