Completed
Push — master ( bf55ad...1b9783 )
by James Ekow Abaka
01:52
created
src/DataOperations.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
         $relationships = $this->wrapper->getDescription()->getRelationships();
157 157
         $presentRelationships = [];
158 158
         
159
-        foreach($relationships ?? [] as $model => $relationship) {
160
-            if(isset($record[$model])) {
159
+        foreach ($relationships ?? [] as $model => $relationship) {
160
+            if (isset($record[$model])) {
161 161
                 $relationship->preSave($record, $record[$model]);
162 162
                 $presentRelationships[$model] = $relationship;
163 163
             }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         
182 182
         // Reset the data so it contains any modifications made by callbacks
183 183
         $record = $this->wrapper->getData()[0];
184
-        foreach($presentRelationships as $model => $relationship) {
184
+        foreach ($presentRelationships as $model => $relationship) {
185 185
             $relationship->postSave($record);
186 186
         }        
187 187
 
Please login to merge, or discard this patch.
src/Resolver.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         }
41 41
         $classes = [$classA['class'], $classB['class']];
42 42
         sort($classes);
43
-        return "{$classA['namespace']}\\" . implode('', $classes);
43
+        return "{$classA['namespace']}\\".implode('', $classes);
44 44
     }
45 45
 
46 46
     public function getTableName($instance) {
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
     public static function getDriverAdapterClassName($driver = false) {
53 53
         if ($driver) {
54
-            return __NAMESPACE__ . '\adapters\\' . Text::ucamelize($driver) . 'Adapter';
54
+            return __NAMESPACE__.'\adapters\\'.Text::ucamelize($driver).'Adapter';
55 55
         }
56 56
         throw new NibiiException("Please specify a driver");
57 57
     }
Please login to merge, or discard this patch.
src/QueryEngine.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
             $valueFields[] = ":{$field}";
30 30
         }
31 31
 
32
-        return "INSERT INTO " . $table .
33
-            " (" . implode(", ", $quotedFields) . ") VALUES (" . implode(', ', $valueFields) . ")";
32
+        return "INSERT INTO ".$table.
33
+            " (".implode(", ", $quotedFields).") VALUES (".implode(', ', $valueFields).")";
34 34
     }
35 35
 
36 36
     public function getBulkUpdateQuery($data, $parameters) {
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
             }
72 72
         }
73 73
 
74
-        return "UPDATE " .
75
-            $model->getDBStoreInformation()['quoted_table'] .
76
-            " SET " . implode(', ', $valueFields) .
77
-            " WHERE " . implode(' AND ', $conditions);
74
+        return "UPDATE ".
75
+            $model->getDBStoreInformation()['quoted_table'].
76
+            " SET ".implode(', ', $valueFields).
77
+            " WHERE ".implode(' AND ', $conditions);
78 78
     }
79 79
 
80 80
     public function getSelectQuery($parameters) {
Please login to merge, or discard this patch.
src/UniqueValidation.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
 
27 27
 namespace ntentan\nibii;
28 28
 
29
-use ntentan\utils\validator\Validation;
30 29
 use ntentan\panie\Container;
30
+use ntentan\utils\validator\Validation;
31 31
 
32 32
 class UniqueValidation extends Validation
33 33
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
         }
69 69
 
70 70
         return $this->evaluateResult(
71
-            $field, $testItem->count() === 0, "The value of " . implode(', ', $field['name']) . " must be unique"
71
+            $field, $testItem->count() === 0, "The value of ".implode(', ', $field['name'])." must be unique"
72 72
         );
73 73
     }
74 74
 
Please login to merge, or discard this patch.
src/ModelDescription.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -103,6 +103,9 @@
 block discarded – undo
103 103
         return $relationshipDetails;
104 104
     }
105 105
 
106
+    /**
107
+     * @param string $type
108
+     */
106 109
     private function createRelationships($type, $relationships)
107 110
     {
108 111
         foreach ($relationships as $relationship) {
Please login to merge, or discard this patch.
src/ModelFactoryInterface.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -11,6 +11,15 @@
 block discarded – undo
11 11
 
12 12
 interface ModelFactoryInterface
13 13
 {
14
+    /**
15
+     * @param string $name
16
+     */
14 17
     public function createModel($name, $context);
18
+
19
+    /**
20
+     * @param RecordWrapper $instance
21
+     *
22
+     * @return string
23
+     */
15 24
     public function getModelTable($instance);
16 25
 }
17 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/Operations.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -24,6 +24,9 @@
 block discarded – undo
24 24
         'save', 'validate'
25 25
     ];
26 26
 
27
+    /**
28
+     * @param string $table
29
+     */
27 30
     public function __construct(RecordWrapper $wrapper, $table) {
28 31
         $this->wrapper = $wrapper;
29 32
         $this->adapter = $wrapper->getAdapter();
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace ntentan\nibii;
4 4
 
5
-use ntentan\panie\Container;
6
-
7 5
 class Operations {
8 6
 
9 7
     private $wrapper;
Please login to merge, or discard this patch.
src/ORMContext.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -99,6 +99,9 @@
 block discarded – undo
99 99
         return $this->config;
100 100
     }
101 101
 
102
+    /**
103
+     * @param RecordWrapper $model
104
+     */
102 105
     public function getModelDescription($model)
103 106
     {
104 107
         return new ModelDescription($model);
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use ntentan\atiaa\DbContext;
6 6
 use ntentan\kaikai\Cache;
7
-use ntentan\panie\Container;
8 7
 
9 8
 /**
10 9
  * A collection of utility methods used as helpers for loading models.
Please login to merge, or discard this patch.
src/QueryOperations.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,6 @@
 block discarded – undo
50 50
     /**
51 51
      * 
52 52
      * @param RecordWrapper $wrapper
53
-     * @param DriverAdapter $adapter
54 53
      * @param DataOperations $dataOperations
55 54
      */
56 55
     public function __construct(RecordWrapper $wrapper, DataOperations $dataOperations, Driver $driver) {
Please login to merge, or discard this patch.