@@ -67,7 +67,9 @@ |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | public static function getInstance() { |
70 | - if(self::$instance === null) throw new NibiiException("A context has not yet been initialized"); |
|
70 | + if(self::$instance === null) { |
|
71 | + throw new NibiiException("A context has not yet been initialized"); |
|
72 | + } |
|
71 | 73 | return self::$instance; |
72 | 74 | } |
73 | 75 |
@@ -26,8 +26,8 @@ |
||
26 | 26 | |
27 | 27 | namespace ntentan\nibii\relationships; |
28 | 28 | |
29 | -use ntentan\utils\Text; |
|
30 | 29 | use ntentan\nibii\ORMContext; |
30 | +use ntentan\utils\Text; |
|
31 | 31 | |
32 | 32 | class BelongsToRelationship extends \ntentan\nibii\Relationship { |
33 | 33 |
@@ -26,8 +26,8 @@ |
||
26 | 26 | |
27 | 27 | namespace ntentan\nibii\relationships; |
28 | 28 | |
29 | -use ntentan\utils\Text; |
|
30 | 29 | use ntentan\nibii\ORMContext; |
30 | +use ntentan\utils\Text; |
|
31 | 31 | |
32 | 32 | class HasManyRelationship extends \ntentan\nibii\Relationship { |
33 | 33 |
@@ -26,9 +26,9 @@ |
||
26 | 26 | |
27 | 27 | namespace ntentan\nibii\relationships; |
28 | 28 | |
29 | -use ntentan\utils\Text; |
|
30 | -use ntentan\nibii\ORMContext; |
|
31 | 29 | use ntentan\nibii\NibiiException; |
30 | +use ntentan\nibii\ORMContext; |
|
31 | +use ntentan\utils\Text; |
|
32 | 32 | |
33 | 33 | class ManyHaveManyRelationship extends \ntentan\nibii\Relationship { |
34 | 34 |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use ntentan\nibii\interfaces\ModelClassResolverInterface; |
6 | 6 | use ntentan\nibii\interfaces\ModelJoinerInterface; |
7 | 7 | use ntentan\nibii\interfaces\TableNameResolverInterface; |
8 | -use ntentan\config\Config; |
|
9 | 8 | use ntentan\utils\Text; |
10 | 9 | |
11 | 10 | /** |
@@ -58,7 +58,9 @@ |
||
58 | 58 | private $initialized = false; |
59 | 59 | |
60 | 60 | public function initialize() { |
61 | - if($this->initialized) return; |
|
61 | + if($this->initialized) { |
|
62 | + return; |
|
63 | + } |
|
62 | 64 | $this->context = ORMContext::getInstance(); |
63 | 65 | $this->container = $this->context->getContainer(); |
64 | 66 | $this->adapter = $this->container->resolve(DriverAdapter::class); |