Completed
Push — master ( b112db...b25060 )
by Vladimir
10:13
created

SendMessage::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Foundation\Commands;
6
7
use FondBot\Channels\Chat;
8
use FondBot\Channels\User;
9
use Illuminate\Bus\Queueable;
10
use InvalidArgumentException;
11
use FondBot\Contracts\Template;
12
use Illuminate\Queue\InteractsWithQueue;
13
use Illuminate\Contracts\Queue\ShouldQueue;
14
15
class SendMessage implements ShouldQueue
16
{
17
    use InteractsWithQueue, Queueable;
18
19
    private $chat;
20
    private $recipient;
21
    private $text;
22
    private $template;
23
24 5
    public function __construct(Chat $chat, User $recipient, string $text = null, Template $template = null)
25
    {
26 5
        if ($text === null && $template === null) {
27 1
            throw new InvalidArgumentException('Either text or template should be set.');
28
        }
29
30 4
        $this->chat = $chat;
31 4
        $this->recipient = $recipient;
32 4
        $this->text = $text;
33 4
        $this->template = $template;
34 4
    }
35
36 1
    public function handle(): void
37
    {
38
        // TODO
39 1
    }
40
}
41