MethodMatcher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 18 1
A getName() 0 4 1
A getMethod() 0 4 1
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
}