Completed
Pull Request — develop (#32)
by Michael
06:53
created

CommandMatcher::matches()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 3
eloc 4
nc 4
nop 1
crap 3
1
<?php
2
3
namespace Crummy\Phlack\Common\Matcher;
4
5
use Crummy\Phlack\WebHook\CommandInterface;
6
use Crummy\Phlack\WebHook\SlashCommand;
7
8
class CommandMatcher extends CommandNameMatcher
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 4
    public function matches(CommandInterface $command)
14
    {
15 4
        return null === $this->commandName
16 2
            ? $command instanceof SlashCommand
17 4
            : $command instanceof SlashCommand && parent::matches($command);
18
    }
19
}
20