Commit 9c43213f authored by Marco Boretto's avatar Marco Boretto

Merge pull request #84 from noplanman/further_code_cleanup

Some typo corrections.
parents 970ae10b 1249dfc9
......@@ -22,15 +22,16 @@ If you develop a new feature please create a new branch.
Version
-------
Version number: 0.#version.#hotfix
Further code convention adopted
-------------------------------
- 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.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
......@@ -41,10 +42,9 @@ Further code convention adopted
```
- No empty line after class declaration
- No empty line after `<?php`
- Last element of array must end with coma
- One empty line after the dockblock header
- Array and use statement must be written in alphabetical order
- Last element of a multi-line array must be followed by a comma
- One empty line after the docblock header
- Array elements and `use` statements should be written in a logical order, preferrably alphabetically
- Use [] instead of array()
- Use '' for string
- Use single quotes (`'`) for string
- Leave space in front and behind the concatenation operator `.`
......@@ -15,8 +15,7 @@ use Longman\TelegramBot\Entities\Update;
use Longman\TelegramBot\Entities\User;
/**
* Class Commad.
*
* Class Command
*/
abstract class Command
{
......@@ -180,8 +179,8 @@ abstract class Command
/**
* Get command config
*
* Look for paramenter $name if found return it, if not return null.
* If $name is not set return the all params setted
* Look for parameter $name if found return it, if not return null.
* If $name is not set return the all set params
*
* @param string|null $name
* @return mixed
......
......@@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot;
define('BASE_PATH', dirname(__FILE__));
......@@ -46,7 +47,7 @@ class Telegram
/**
* Raw request data (json) for webhook methods
*
*
* @var string
*/
protected $input;
......@@ -61,8 +62,7 @@ class Telegram
/**
* Row custom update (json)
*
* Used to inject a custom update fot testing purpose in the
* request class
* Used to inject a custom update for testing purposes in the Request class
*
* @var string
*/
......@@ -376,12 +376,12 @@ class Telegram
/**
* Handle bot request from wekhook
*
* @todo Should return the executed command result (true,false) but we shoud check if all commands return a value.
* Furthermore this function is the tween of handleGetUpdates for webhook, but the first return the ServerResponse
* instead the latter return if the command has failed or not (true|false).
* @todo Should return the executed command result (true|false) but we shoud check if all commands return a value.
* Furthermore this function is the twin of handleGetUpdates for webhook, but the first returns the ServerResponse
* instead the latter return if the command has failed or not (true|false).
* We shoud use the same convention for both.
*
* @return bool
* @return bool
*/
public function handle()
{
......@@ -514,11 +514,11 @@ class Telegram
/**
* Get command class
*
* @todo check return
*
* @param string $command
* @param \Longman\TelegramBot\Entities\ServerResponse|null $update
*
* @TODO check return
*
* @return object
*/
public function getCommandClass($command, Update $update = null)
......@@ -671,7 +671,7 @@ class Telegram
* Set command config
*
* Provide further variables to a particular commands.
* For example you can add the channel name at the command /sendtochannel
* For example you can add the channel name at the command /sendtochannel
* Or you can add the api key for external service.
*
*
......
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