Message::getMessage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
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
}