Completed
Push — master ( f8d19f...145f77 )
by James Ekow Abaka
03:49
created

Nibii   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 12
Bugs 3 Features 4
Metric Value
wmc 6
c 12
b 3
f 4
lcom 0
cbo 1
dl 0
loc 34
ccs 10
cts 15
cp 0.6667
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A joinModels() 0 4 1
A getClassName() 0 4 1
A load() 0 4 1
A getModelTable() 0 4 1
A getModelName() 0 4 1
A setupDefaultBindings() 0 6 1
1
<?php
2
3
namespace ntentan\nibii;
4
5
use ntentan\panie\InjectionContainer;
6
7
class Nibii
8
{
9 6
    public static function load($path)
10
    {
11 6
        return InjectionContainer::resolve(self::getClassName($path));
12
    }
13
    
14 4
    public static function joinModels($classA, $classB)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
15
    {
16 4
        return InjectionContainer::singleton(interfaces\ModelJoinerInterface::class)->getJunctionClassName($classA, $classB);
17
    }
18
    
19 36
    public static function getModelTable($instance)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
20
    {
21 36
        return InjectionContainer::singleton(interfaces\TableNameResolverInterface::class)->getTableName($instance);
22
    }
23
24 14
    public static function getClassName($model, $context = null)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
25
    {
26 14
        return InjectionContainer::singleton(interfaces\ClassResolverInterface::class)->getModelClassName($model, $context);
27
    }
28
    
29 8
    public static function getModelName($class)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
30
    {
31 8
        return $class;
32
    }
33
    
34
    public static function setupDefaultBindings()
35
    {
36
        InjectionContainer::bind(interfaces\ModelJoinerInterface::class, ClassNameResolver::class);
37
        InjectionContainer::bind(interfaces\TableNameResolverInterface::class, ClassNameResolver::class);
38
        InjectionContainer::bind(interfaces\ClassResolverInterface::class, ClassNameResolver::class);
39
    }
40
}
41