@@ -40,6 +40,9 @@ |
||
| 40 | 40 | $this->entity = $entity; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $text |
|
| 45 | + */ |
|
| 43 | 46 | protected function sendMessage($text) |
| 44 | 47 | { |
| 45 | 48 | $chatId = $this->getChatId(); |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Teebot; |
| 4 | 4 | |
| 5 | -use Teebot\Exception; |
|
| 6 | 5 | use Teebot\Method\GetUpdates; |
| 7 | 6 | use Teebot\Command\Executor; |
| 8 | 7 | use Teebot\Exception\Fatal; |
@@ -84,6 +84,9 @@ |
||
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | + /** |
|
| 88 | + * @param string $args |
|
| 89 | + */ |
|
| 87 | 90 | protected function buildUrl($method, $args = null) |
| 88 | 91 | { |
| 89 | 92 | $url = sprintf( |
@@ -36,6 +36,9 @@ |
||
| 36 | 36 | $this->entities = $this->buildEntities($entitiesSource, $entityType); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param string $rawData |
|
| 41 | + */ |
|
| 39 | 42 | protected function decodeData($rawData) { |
| 40 | 43 | if (!is_string($rawData) || !strlen($rawData)) { |
| 41 | 44 | return []; |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | $entity = null; |
| 111 | 111 | |
| 112 | 112 | if (!class_exists($entityClassName)) { |
| 113 | - throw new Critical('Entity "'.$entityType.'" does not exists or not supported yet!'); |
|
| 113 | + throw new Critical('Entity "' . $entityType . '" does not exists or not supported yet!'); |
|
| 114 | 114 | } |
| 115 | 115 | /** @var AbstractEntity $entity */ |
| 116 | 116 | $entity = new $entityClassName($rawItemData); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | - call_user_func_array([$this, $method], ['1','2','3']); |
|
| 46 | + call_user_func_array([$this, $method], ['1', '2', '3']); |
|
| 47 | 47 | } catch (Fatal $e) { |
| 48 | 48 | echo $e->getMessage(); |
| 49 | 49 | exit; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | echo "\nCreating a new bot.\n"; |
| 84 | 84 | |
| 85 | - echo $botName." - ".$token." - ".$dir; |
|
| 85 | + echo $botName . " - " . $token . " - " . $dir; |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | { |
| 62 | 62 | foreach ($this->supportedProperties as $property => $isRequired) { |
| 63 | 63 | if ($isRequired === true && empty($args[$property])) { |
| 64 | - throw new Fatal('Required property "'.$property.'" is not set!'); |
|
| 64 | + throw new Fatal('Required property "' . $property . '" is not set!'); |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | protected function getCommandClass($command) |
| 108 | 108 | { |
| 109 | 109 | $parts = explode(static::COMMAND_PARTS_DELIMITER, $command); |
| 110 | - array_walk($parts, function (&$part) { |
|
| 110 | + array_walk($parts, function(&$part) { |
|
| 111 | 111 | $part = ucfirst($part); |
| 112 | 112 | }); |
| 113 | 113 | |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @author Stan Drozdov <[email protected]> |
|
| 4 | - * Teebot entrypoint |
|
| 5 | - */ |
|
| 3 | + * @author Stan Drozdov <[email protected]> |
|
| 4 | + * Teebot entrypoint |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | define('ROOT_DIR', realpath(__DIR__)); |
| 8 | 8 | require_once ROOT_DIR . '/vendor/autoload.php'; |