BaseRedisMessageModel   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
c 3
b 0
f 0
lcom 1
cbo 2
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 11 3
1
<?php
2
3
/**
4
 *  _   __ __ _____ _____ ___  ____  _____
5
 * | | / // // ___//_  _//   ||  __||_   _|
6
 * | |/ // /(__  )  / / / /| || |     | |
7
 * |___//_//____/  /_/ /_/ |_||_|     |_|
8
 * @link https://vistart.name/
9
 * @copyright Copyright (c) 2016 vistart
10
 * @license https://vistart.name/license/
11
 */
12
13
namespace vistart\Models\models;
14
15
use vistart\Models\queries\BaseRedisMessageQuery;
16
use vistart\Models\traits\MessageTrait;
17
18
/**
19
 * This model helps build message model stored in redis.
20
 *
21
 * @version 2.0
22
 * @author vistart <[email protected]>
23
 */
24
abstract class BaseRedisMessageModel extends BaseRedisBlameableModel
25
{
26
    use MessageTrait;
27
28
    public $updatedByAttribute = false;
29
    public $expiredAt = 604800; // 7 days.
30
31 4
    public function init()
32
    {
33 4
        if (!is_string($this->queryClass)) {
34 4
            $this->queryClass = BaseRedisMessageQuery::className();
35 4
        }
36 4
        if ($this->skipInit) {
37 4
            return;
38
        }
39 4
        $this->initMessageEvents();
40 4
        parent::init();
41 4
    }
42
}
43