CacheSupportCachelet   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 18
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getId() 0 10 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Saito - The Threaded Web Forum
7
 *
8
 * @copyright Copyright (c) the Saito Project Developers
9
 * @link https://github.com/Schlaefer/Saito
10
 * @license http://opensource.org/licenses/MIT
11
 */
12
13
namespace Saito\Cache;
14
15
abstract class CacheSupportCachelet implements CacheSupportCacheletInterface
16
{
17
18
    /**
19
     * get cachelet id
20
     *
21
     * @return mixed
22
     */
23
    public function getId()
24
    {
25
        if (!empty($this->_title)) {
26
            return $this->_title;
27
        }
28
29
        return preg_replace(
30
            '/Saito\\\Cache\\\(.*)CacheSupportCachelet/',
31
            '\\1',
32
            get_class($this)
33
        );
34
    }
35
}
36