Message   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getMessage() 0 2 1
A sendAt() 0 3 1
A getBody() 0 6 2
A makeAt() 0 5 1
1
<?php
2
3
namespace DingNotice\Messages;
4
5
abstract class Message
6
{
7
    protected $message = [];
8
    protected $at;
9
10
11
    public function getMessage(){
12
        return $this->message;
13
    }
14
15
    protected function makeAt($mobiles = [],$atAll = false){
16
        return [
17
            'at' => [
18
                'atMobiles' => $mobiles,
19
                'isAtAll' => $atAll
20
            ]
21
        ];
22
    }
23
24
    public function sendAt($mobiles = [],$atAll = false){
25
        $this->at = $this->makeAt($mobiles,$atAll);
26
        return $this;
27
    }
28
29
    public function getBody(){
30
31
        if (empty($this->at)){
32
            $this->sendAt();
33
        }
34
        return $this->message + $this->at;
35
    }
36
37
}