@@ -9,5 +9,8 @@ |
||
9 | 9 | */ |
10 | 10 | interface TableNameResolverInterface |
11 | 11 | { |
12 | + /** |
|
13 | + * @return string |
|
14 | + */ |
|
12 | 15 | public function getTableName($instance); |
13 | 16 | } |
@@ -8,10 +8,10 @@ |
||
8 | 8 | |
9 | 9 | namespace ntentan\nibii; |
10 | 10 | |
11 | +use ntentan\config\Config; |
|
11 | 12 | use ntentan\nibii\interfaces\ClassResolverInterface; |
12 | 13 | use ntentan\nibii\interfaces\ModelJoinerInterface; |
13 | 14 | use ntentan\nibii\interfaces\TableNameResolverInterface; |
14 | -use ntentan\config\Config; |
|
15 | 15 | use ntentan\utils\Text; |
16 | 16 | |
17 | 17 | /** |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | public function getModelClassName($default, $context) |
26 | 26 | { |
27 | - if(self::$classResolver !== null && $model[0] !== "\\") { |
|
27 | + if (self::$classResolver !== null && $model[0] !== "\\") { |
|
28 | 28 | $resolver = self::$classResolver; |
29 | 29 | $className = $resolver($model, $context); |
30 | 30 | } else { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $arrayed = explode('\\', $className); |
39 | 39 | $class = array_pop($arrayed); |
40 | - if($arrayed[0] == '') { |
|
40 | + if ($arrayed[0] == '') { |
|
41 | 41 | array_shift($arrayed); |
42 | 42 | } |
43 | 43 | return ['class' => $class, 'namespace' => implode('\\', $arrayed)]; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | $classA = $this->getClassFileDetails($classA); |
49 | 49 | $classB = $this->getClassFileDetails($classB); |
50 | - if($classA['namespace'] != $classB['namespace']) { |
|
50 | + if ($classA['namespace'] != $classB['namespace']) { |
|
51 | 51 | throw new NibiiException( |
52 | 52 | "Cannot automatically join two classes of different " |
53 | 53 | . "namespaces. Please provide a model joiner or " |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | $classes = [$classA['class'], $classB['class']]; |
58 | 58 | sort($classes); |
59 | - return "{$classA['namespace']}\\" . implode('', $classes); |
|
59 | + return "{$classA['namespace']}\\".implode('', $classes); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | public function getTableName($instance) |
@@ -68,6 +68,6 @@ discard block |
||
68 | 68 | |
69 | 69 | public static function getDriverAdapterClassName() |
70 | 70 | { |
71 | - return __NAMESPACE__ . '\adapters\\' . Text::ucamelize(Config::get('ntentan:db.driver')) . 'Adapter'; |
|
71 | + return __NAMESPACE__.'\adapters\\'.Text::ucamelize(Config::get('ntentan:db.driver')).'Adapter'; |
|
72 | 72 | } |
73 | 73 | } |