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

NamespacedEntity::getEntityNamespace()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
nc 2
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 0
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