SlackTrait::say()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Nopolabs\Yabot\Helpers;
4
5
use Nopolabs\Yabot\Slack\Client;
6
7
trait SlackTrait
8
{
9
    /** @var Client */
10
    private $slack;
11
12
    public function setSlack(Client $slack)
13
    {
14
        $this->slack = $slack;
15
    }
16
17
    public function getSlack() : Client
18
    {
19
        return $this->slack;
20
    }
21
22
    public function say($text, $channel, array $additionalParameters = [])
23
    {
24
        $this->getSlack()->say($text, $channel, $additionalParameters);
25
    }
26
27
    public function getUserById($userId)
28
    {
29
        return $this->getSlack()->getUserById($userId);
30
    }
31
32
    public function getChannelById($channelId)
33
    {
34
        return $this->getSlack()->getChannelById($channelId);
35
    }
36
37
    public function getAuthedUser()
38
    {
39
        return $this->getSlack()->getAuthedUser();
40
    }
41
}