@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | private $client; |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | - * @param APIClient $client |
|
| 19 | + * @param APIPollClient $client |
|
| 20 | 20 | */ |
| 21 | 21 | public function __construct(APIPollClient $client) |
| 22 | 22 | { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * @param APIMessage $message |
| 74 | - * @return function |
|
| 74 | + * @return \Closure |
|
| 75 | 75 | */ |
| 76 | 76 | public function getResponder(APIMessage $message) |
| 77 | 77 | { |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | */ |
| 76 | 76 | public function getResponder(APIMessage $message) |
| 77 | 77 | { |
| 78 | - return function ($text) use ($message) { |
|
| 78 | + return function($text) use ($message) { |
|
| 79 | 79 | $this->client->send($text, $message); |
| 80 | 80 | }; |
| 81 | 81 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $this->botCommand('getUpdates', ['offset' => $this->offset]) |
| 35 | 35 | ); |
| 36 | 36 | $request->on('response', $responseHandler); |
| 37 | - $request->on('error', function ($data) { |
|
| 37 | + $request->on('error', function($data) { |
|
| 38 | 38 | throw new \Exception($data); |
| 39 | 39 | }); |
| 40 | 40 | $request->end(); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function markMessageHandled(APIMessage $message) |
| 61 | 61 | { |
| 62 | - $this->offset = $message->getUpdateId() +1; |
|
| 62 | + $this->offset = $message->getUpdateId()+1; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | public function getResponseHeaders(string $responseString) :array |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use TelegramBot\BotInterface; |
| 6 | 6 | use TelegramBot\BotFactory; |
| 7 | 7 | use PhpSpec\ObjectBehavior; |
| 8 | -use Prophecy\Argument; |
|
| 9 | 8 | |
| 10 | 9 | class BotFactorySpec extends ObjectBehavior |
| 11 | 10 | { |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use TelegramBot\Bot; |
| 6 | 6 | use TelegramBot\APIPollClient; |
| 7 | 7 | use PhpSpec\ObjectBehavior; |
| 8 | -use Prophecy\Argument; |
|
| 9 | 8 | |
| 10 | 9 | class BotSpec extends ObjectBehavior |
| 11 | 10 | { |
@@ -2,10 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace spec\TelegramBot; |
| 4 | 4 | |
| 5 | -use TelegramBot\BotInterface; |
|
| 6 | 5 | use TelegramBot\ReactRunner; |
| 7 | 6 | use PhpSpec\ObjectBehavior; |
| 8 | -use Prophecy\Argument; |
|
| 9 | 7 | |
| 10 | 8 | class ReactRunnerSpec extends ObjectBehavior |
| 11 | 9 | { |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | $this->loop->addPeriodicTimer( |
| 54 | 54 | $this->loopTimeout, |
| 55 | - function (\React\EventLoop\Timer\Timer $timer) use ($bot, $maxTimesToPoll) { |
|
| 55 | + function(\React\EventLoop\Timer\Timer $timer) use ($bot, $maxTimesToPoll) { |
|
| 56 | 56 | $bot->poll(); |
| 57 | 57 | $this->loopCounter++; |
| 58 | 58 | if (!is_null($maxTimesToPoll) && ($maxTimesToPoll >= $this->loopCounter)) { |