MethodMatcher::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 1
nc 1
nop 7
1
<?php
2
3
namespace Nopolabs\Yabot\Plugin;
4
5
6
use Nopolabs\Yabot\Helpers\LogTrait;
7
use Nopolabs\Yabot\Helpers\MatcherTrait;
8
use Nopolabs\Yabot\Message\Message;
9
use Psr\Log\LoggerInterface;
10
11
class MethodMatcher
12
{
13
    use LogTrait;
14
    use MatcherTrait;
15
16
    private $method;
17
18
    public function __construct(
19
        string $name,
20
        $isBot,
21
        array $channels,
22
        array $users,
23
        array $patterns,
24
        string $method,
25
        LoggerInterface $logger = null)
26
    {
27
        $this->setName($name);
28
        $this->setIsBot($isBot);
29
        $this->setChannels($channels);
30
        $this->setUsers($users);
31
        $this->setPatterns($patterns);
32
        $this->setLog($logger);
33
34
        $this->method = $method;
35
    }
36
37
    public function getName(): string
38
    {
39
        return $this->name;
40
    }
41
42
    public function getMethod(): string
43
    {
44
        return $this->method;
45
    }
46
}