Completed
Push — master ( 3452a0...52893e )
by
unknown
22:08 queued 22:05
created

BangMessage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 19
rs 10
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A bangCommand() 0 4 1
A text() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Spires\Plugins\BangMessage\Inbound;
5
6
use Spires\Plugins\Message\Inbound\Message;
7
8
class BangMessage extends Message
9
{
10
    /**
11
     * The bang command
12
     * e.g. the message "!somersault mouse acrobat"
13
     * would return "somersault" as the bang command
14
     *
15
     * @return string
16
     */
17
    public function bangCommand()
18
    {
19
        return head(explode(' ', $this->text()));
20
    }
21
22
    public function text()
23
    {
24
        return ltrim(parent::text(), '!');
25
    }
26
}
27