TagManagerRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getNamespaces() 0 4 1
A registerNamespace() 0 4 1
1
<?php
2
3
namespace Modules\Tag\Repositories;
4
5
use Modules\Tag\Contracts\TaggableInterface;
6
7
class TagManagerRepository implements TagManager
8
{
9
    /**
10
     * Array of registered namespaces.
11
     * @var array
12
     */
13
    private $namespaces = [];
14
15
    /**
16
     * Returns all the registered namespaces.
17
     * @return array
18
     */
19 2
    public function getNamespaces()
20
    {
21 2
        return $this->namespaces;
22
    }
23
24
    /**
25
     * Registers an entity namespace.
26
     * @param TaggableInterface $entity
27
     * @return void
28
     */
29 10
    public function registerNamespace(TaggableInterface $entity)
30
    {
31 10
        $this->namespaces[] = $entity->getEntityNamespace();
32 10
    }
33
}
34