SubscriptionMeta   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 21
c 2
b 1
f 0
dl 0
loc 42
ccs 0
cts 20
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 12 1
A __construct() 0 8 1
1
<?php
2
3
namespace Freyo\LaravelQueueCMQ\Queue\Driver;
4
5
class SubscriptionMeta
6
{
7
    // default NotifyStrategy      BACKOFF_RETRY
8
    // default NotifyContentFormat JSON
9
10
    /* 订阅属性
11
     @note: 可修改
12
     :: Endpoint            推送消息地址
13
     :: Protocal            协议
14
     :: FilterTag           订阅 标签
15
     :: NotifyStrategy      重试策略
16
     :: NotifyContentFormat 推送消息格式
17
     */
18
    public $Endpoint;
19
    public $Protocol;
20
    public $FilterTag;
21
    public $NotifyStrategy;
22
    public $NotifyContentFormat;
23
    public $bindingKey;
24
25
    public function __construct()
26
    {
27
        $this->Endpoint = '';
28
        $this->Protocol = '';
29
        $this->FilterTag = [];
30
        $this->NotifyStrategy = 'BACKOFF_RETRY';
31
        $this->NotifyContentFormat = 'JSON';
32
        $this->bindingKey = [];
33
    }
34
35
    public function __toString()
36
    {
37
        $info = [
38
            'endpoint'            => $this->Endpoint,
39
            'protocol'            => $this->Protocol,
40
            'filterTag'           => $this->FilterTag,
41
            'notifyStrategy'      => $this->NotifyStrategy,
42
            'notifyContentFormat' => $this->NotifyContentFormat,
43
            'bindingKey'          => $this->bindingKey,
44
        ];
45
46
        return json_encode($info);
47
    }
48
}
49