@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | /** |
| 96 | 96 | * Sets entity |
| 97 | 97 | * |
| 98 | - * @param EntityInterface $entity Entity object |
|
| 98 | + * @param \Teebot\Api\Entity\EntityInterface $entity Entity object |
|
| 99 | 99 | * |
| 100 | 100 | * @return EventInterface |
| 101 | 101 | */ |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * |
| 112 | 112 | * @param string $text Message text |
| 113 | 113 | * |
| 114 | - * @return Response |
|
| 114 | + * @return \Teebot\Api\Response |
|
| 115 | 115 | */ |
| 116 | 116 | protected function sendMessage(string $text): Response |
| 117 | 117 | { |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | /** |
| 125 | 125 | * Replies on the message |
| 126 | 126 | * |
| 127 | - * @param SendMessage $sendMessage Object of the SendMessage method |
|
| 127 | + * @param \Teebot\Api\Method\SendMessage $sendMessage Object of the SendMessage method |
|
| 128 | 128 | * |
| 129 | - * @return Response |
|
| 129 | + * @return \Teebot\Api\Response |
|
| 130 | 130 | */ |
| 131 | 131 | protected function reply(SendMessage $sendMessage): Response |
| 132 | 132 | { |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @author Stanislav Drozdov <[email protected]> |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -declare(strict_types=1); |
|
| 13 | +declare(strict_types = 1); |
|
| 14 | 14 | |
| 15 | 15 | namespace Teebot\Api\Command; |
| 16 | 16 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | { |
| 133 | 133 | $chatId = $this->getChatId(); |
| 134 | 134 | |
| 135 | - if ((int)$chatId == 0) { |
|
| 135 | + if ((int) $chatId == 0) { |
|
| 136 | 136 | return false; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | protected $httpClient; |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | - * @param ContainerInterface $config |
|
| 54 | - * @param HttpClient $httpClient |
|
| 53 | + * @param \Teebot\Configuration\ContainerInterface $config |
|
| 54 | + * @param \Teebot\Api\HttpClient $httpClient |
|
| 55 | 55 | */ |
| 56 | 56 | public function __construct(ContainerInterface $config, HttpClient $httpClient) |
| 57 | 57 | { |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | /** |
| 63 | 63 | * Returns configuration container |
| 64 | 64 | * |
| 65 | - * @return ContainerInterface |
|
| 65 | + * @return \Teebot\Configuration\ContainerInterface |
|
| 66 | 66 | */ |
| 67 | 67 | public function getConfig(): ContainerInterface |
| 68 | 68 | { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * - Inline Query |
| 107 | 107 | * - Chosen Inline Result |
| 108 | 108 | * |
| 109 | - * @param EntityInterface $entity Update or Error entity object |
|
| 109 | + * @param \Teebot\Api\Entity\EntityInterface $entity Update or Error entity object |
|
| 110 | 110 | * |
| 111 | 111 | * @return array |
| 112 | 112 | */ |
@@ -181,8 +181,8 @@ discard block |
||
| 181 | 181 | * will not be triggered otherwise process will continue until either first false returned or the very |
| 182 | 182 | * last event in the flow. |
| 183 | 183 | * |
| 184 | - * @param EntityInterface $entity Entity for which the corresponding event should be triggered |
|
| 185 | - * @param EntityInterface $parent Entity's parent if any |
|
| 184 | + * @param \Teebot\Api\Entity\EntityInterface $entity Entity for which the corresponding event should be triggered |
|
| 185 | + * @param \Teebot\Api\Entity\EntityInterface $parent Entity's parent if any |
|
| 186 | 186 | * |
| 187 | 187 | * @return bool |
| 188 | 188 | */ |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | /** |
| 225 | 225 | * Returns event configuration item search by the data from entity |
| 226 | 226 | * |
| 227 | - * @param EntityInterface $entity Entity for which the corresponding event should be triggered |
|
| 227 | + * @param \Teebot\Api\Entity\EntityInterface $entity Entity for which the corresponding event should be triggered |
|
| 228 | 228 | * be treated as a command |
| 229 | 229 | * |
| 230 | 230 | * @return null|EventConfig |
@@ -285,9 +285,9 @@ discard block |
||
| 285 | 285 | * @param MethodInterface $method Method instance |
| 286 | 286 | * @param bool $silentMode If set to true then the events, mapped (in config or by default) |
| 287 | 287 | * to the entities in the result will not be triggered |
| 288 | - * @param EntityInterface $parent Parent entity (if any) |
|
| 288 | + * @param \Teebot\Api\Entity\EntityInterface $parent Parent entity (if any) |
|
| 289 | 289 | * |
| 290 | - * @return Response |
|
| 290 | + * @return \Teebot\Api\Response |
|
| 291 | 291 | */ |
| 292 | 292 | public function call(MethodInterface $method, $silentMode = false, EntityInterface $parent = null) |
| 293 | 293 | { |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | * @param bool $silentMode If set to true then the events, mapped (in config or by default) |
| 306 | 306 | * to the entities in the result will not be triggered |
| 307 | 307 | * |
| 308 | - * @return Response |
|
| 308 | + * @return \Teebot\Api\Response |
|
| 309 | 309 | */ |
| 310 | 310 | public function getWebhookResponse($data, $silentMode = false) |
| 311 | 311 | { |
@@ -317,11 +317,11 @@ discard block |
||
| 317 | 317 | /** |
| 318 | 318 | * Processes entities from the response object if not in silent mode or error is received. |
| 319 | 319 | * |
| 320 | - * @param Response $response Response object which includes entities |
|
| 320 | + * @param \Teebot\Api\Response $response Response object which includes entities |
|
| 321 | 321 | * @param bool $silentMode If set to true then the events, mapped (in config or by default) |
| 322 | 322 | * to the entities in the result will not be triggered |
| 323 | 323 | * |
| 324 | - * @return Response |
|
| 324 | + * @return \Teebot\Api\Response |
|
| 325 | 325 | */ |
| 326 | 326 | protected function processResponse(Response $response, $silentMode = false) |
| 327 | 327 | { |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * @author Stanislav Drozdov <[email protected]> |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -declare(strict_types=1); |
|
| 12 | +declare(strict_types = 1); |
|
| 13 | 13 | |
| 14 | 14 | namespace Teebot\Api\Command; |
| 15 | 15 | |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | * |
| 275 | 275 | * @return bool |
| 276 | 276 | */ |
| 277 | - protected function isCommandSupported(?string $preDefinedCommand, string $command): bool |
|
| 277 | + protected function isCommandSupported(?string $preDefinedCommand, string $command) : bool |
|
| 278 | 278 | { |
| 279 | 279 | return $preDefinedCommand !== null && strtolower($preDefinedCommand) == strtolower($command); |
| 280 | 280 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * |
| 53 | 53 | * @param string $rawData Raw JSON string |
| 54 | 54 | * @param null|string $entityClass Entity class that should be instantiated with decoded JSON data |
| 55 | - * @param null|EntityInterface $parent Parent class should be set as parent for newly instantiated entity |
|
| 55 | + * @param null|Entity\EntityInterface $parent Parent class should be set as parent for newly instantiated entity |
|
| 56 | 56 | * |
| 57 | 57 | * @throws DecodingDataException |
| 58 | 58 | */ |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @param array $rawItemData Array with raw entity's data |
| 151 | 151 | * @param null|string $entityClass Entity class to instantiate, if not passed - default Entity class will be used. |
| 152 | 152 | * |
| 153 | - * @return EntityInterface |
|
| 153 | + * @return Entity\EntityInterface |
|
| 154 | 154 | * |
| 155 | 155 | * @throws BuildEntityException |
| 156 | 156 | */ |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * @author Stanislav Drozdov <[email protected]> |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -declare(strict_types=1); |
|
| 11 | +declare(strict_types = 1); |
|
| 12 | 12 | |
| 13 | 13 | namespace Teebot\Api; |
| 14 | 14 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $entity = $this->buildEntity($rawItemData, $entityClass); |
| 136 | 136 | |
| 137 | 137 | if ($entity && $entity instanceof Update) { |
| 138 | - $this->lastUpdate = (int)$entity->getUpdateId(); |
|
| 138 | + $this->lastUpdate = (int) $entity->getUpdateId(); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $entities[] = $entity; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $entity = null; |
| 161 | 161 | |
| 162 | 162 | if (!class_exists($entityClass)) { |
| 163 | - throw new BuildEntityException('Entity "' . $entityClass . '" does not exists or not supported yet!'); |
|
| 163 | + throw new BuildEntityException('Entity "'.$entityClass.'" does not exists or not supported yet!'); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** @var EntityInterface $entity */ |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * Initializes the Client |
| 54 | 54 | * |
| 55 | - * @param AbstractContainer $config |
|
| 55 | + * @param Configuration\AbstractContainer $config |
|
| 56 | 56 | */ |
| 57 | 57 | protected function init(AbstractContainer $config) |
| 58 | 58 | { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @param int $limit Limit of the updates to get |
| 69 | 69 | * @param bool $silentMode If set to true then the events, mapped (in config or by default) to |
| 70 | 70 | * the entities in the result will not be triggered |
| 71 | - * @return Response |
|
| 71 | + * @return Api\Response |
|
| 72 | 72 | */ |
| 73 | 73 | public function getUpdates( |
| 74 | 74 | $offset = Config::DEFAULT_OFFSET, |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * be passed manually. If not passed - php input will be used to get the data. |
| 128 | 128 | * @param bool $silentMode If set to true then the events, mapped to |
| 129 | 129 | * the entities in the result will not be triggered |
| 130 | - * @return Response |
|
| 130 | + * @return Api\Response |
|
| 131 | 131 | */ |
| 132 | 132 | public function webhook($receivedData = '', $silentMode = false): Response |
| 133 | 133 | { |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * @author Stanislav Drozdov <[email protected]> |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -declare(strict_types=1); |
|
| 12 | +declare(strict_types = 1); |
|
| 13 | 13 | |
| 14 | 14 | namespace Teebot; |
| 15 | 15 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function __construct(AbstractContainer $config) |
| 46 | 46 | { |
| 47 | - define('TEEBOT_ROOT', realpath(__DIR__ . '/../')); |
|
| 47 | + define('TEEBOT_ROOT', realpath(__DIR__.'/../')); |
|
| 48 | 48 | |
| 49 | 49 | $this->init($config); |
| 50 | 50 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | if ($response instanceof Response) { |
| 112 | 112 | $offset = $response->getOffset(); |
| 113 | 113 | } |
| 114 | - } catch (\Exception $e){ |
|
| 114 | + } catch (\Exception $e) { |
|
| 115 | 115 | $this->logger->exception($e); |
| 116 | 116 | } |
| 117 | 117 | |
@@ -51,8 +51,8 @@ |
||
| 51 | 51 | /** |
| 52 | 52 | * Executes command |
| 53 | 53 | * |
| 54 | - * @param InputInterface $input |
|
| 55 | - * @param OutputInterface $output |
|
| 54 | + * @param \Symfony\Component\Console\Input\InputInterface $input |
|
| 55 | + * @param \Symfony\Component\Console\Output\OutputInterface $output |
|
| 56 | 56 | */ |
| 57 | 57 | protected function execute(InputInterface $input, OutputInterface $output) |
| 58 | 58 | { |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Teebot\Command; |
| 6 | 6 | |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
| 138 | - * @return ConfigurationInterface |
|
| 138 | + * @return \Symfony\Component\Config\Definition\ConfigurationInterface |
|
| 139 | 139 | */ |
| 140 | 140 | abstract protected function getConfiguration(): ConfigurationInterface; |
| 141 | 141 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Teebot\Configuration; |
| 6 | 6 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | protected function getFileName(): string |
| 82 | 82 | { |
| 83 | - $env = getenv('ENV') ? '_' . getenv('ENV') : ''; |
|
| 83 | + $env = getenv('ENV') ? '_'.getenv('ENV') : ''; |
|
| 84 | 84 | |
| 85 | 85 | return sprintf(static::FILE_NAME, $env); |
| 86 | 86 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Teebot\Command\Emulator; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Teebot\Command\Emulator; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Teebot\Command\Listener; |
| 6 | 6 | |