Completed
Branch final (ad8b8d)
by Georges
03:08 queued 28s
created

ClassNamespaceResolverTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getClassNamespace() 0 10 2
1
<?php
2
/**
3
 *
4
 * This file is part of phpFastCache.
5
 *
6
 * @license MIT License (MIT)
7
 *
8
 * For full copyright and license information, please see the docs/CREDITS.txt file.
9
 *
10
 * @author Khoa Bui (khoaofgod)  <[email protected]> http://www.phpfastcache.com
11
 * @author Georges.L (Geolim4)  <[email protected]>
12
 *
13
 */
14
15
namespace phpFastCache\Core;
16
17
/**
18
 * Trait ClassNamespaceResolverTrait
19
 * @package phpFastCache\Core
20
 */
21
trait ClassNamespaceResolverTrait
22
{
23
    /**
24
     * @return string
25
     */
26
    protected function getClassNamespace()
27
    {
28
        static $namespace;
29
30
        if (!$namespace) {
31
            $namespace = (new \ReflectionObject($this))->getNamespaceName();
32
        }
33
34
        return $namespace;
35
    }
36
}