Completed
Push — 2.0 ( 823e84...f7747f )
by Nicolas
02:57
created

NamespacedEntity   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntityNamespace() 0 4 2
A setEntityNamespace() 0 4 1
1
<?php
2
3
namespace Modules\Core\Traits;
4
5
trait NamespacedEntity
6
{
7
    /**
8
     * Returns the entity namespace.
9
     *
10
     * @return string
11
     */
12
    public static function getEntityNamespace()
13
    {
14
        return isset(static::$entityNamespace) ? static::$entityNamespace : get_called_class();
15
    }
16
17
    /**
18
     * Sets the entity namespace.
19
     *
20
     * @param  string  $namespace
21
     * @return void
22
     */
23
    public static function setEntityNamespace($namespace)
24
    {
25
        static::$entityNamespace = $namespace;
26
    }
27
}
28