Completed
Branch master (914e59)
by Kirill
02:00
created

UpdateReceiver::handleUpdate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace AppBundle\UpdateReceiver;
4
5
use Shaygan\TelegramBotApiBundle\TelegramBotApi;
6
use Shaygan\TelegramBotApiBundle\Type\Update;
7
use Shaygan\TelegramBotApiBundle\UpdateReceiver\UpdateReceiverInterface;
8
9
class UpdateReceiver implements UpdateReceiverInterface
10
{
11
12
    private $config;
13
    private $telegramBotApi;
14
15
    public function __construct(TelegramBotApi $telegramBotApi, $config)
16
    {
17
        $this->telegramBotApi = $telegramBotApi;
18
        $this->config = $config;
19
    }
20
21
    public function handleUpdate(Update $update)
22
    {
23
        $this->telegramBotApi->sendMessage($message['chat']['id'], 'Hello from Buktopuha, %username%');
0 ignored issues
show
Bug introduced by
The variable $message does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
24
    }
25
}
26