Completed
Push — master ( 6762cf...75869c )
by James Ekow Abaka
01:37
created
src/factories/DriverAdapterFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
     public function createDriverAdapter()
25 25
     {
26
-        $class = 'ntentan\nibii\adapters\\' . Text::ucamelize($this->driverName) . 'Adapter';
26
+        $class = 'ntentan\nibii\adapters\\'.Text::ucamelize($this->driverName).'Adapter';
27 27
         return new $class();
28 28
     }
29 29
 }
Please login to merge, or discard this patch.
src/factories/DefaultModelFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
         }
34 34
         $classes = [$classA['class'], $classB['class']];
35 35
         sort($classes);
36
-        return "{$classA['namespace']}\\" . implode('', $classes);
36
+        return "{$classA['namespace']}\\".implode('', $classes);
37 37
     }
38 38
     
39 39
     private function getClassFileDetails($className) {
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace ntentan\nibii\factories;
4 4
 
5
-use ntentan\utils\Text;
6 5
 use ntentan\nibii\interfaces\ModelFactoryInterface;
6
+use ntentan\utils\Text;
7 7
 
8 8
 class DefaultModelFactory implements ModelFactoryInterface
9 9
 {
Please login to merge, or discard this patch.
src/RecordWrapper.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
             $this->table = $table['table'];
85 85
             $this->schema = $table['schema'];
86 86
         }
87
-        $this->quotedTable = ($this->schema ? "{$driver->quoteIdentifier($this->schema)}." : "") . $driver->quoteIdentifier($this->table);
88
-        $this->unquotedTable = ($this->schema ? "{$this->schema}." : "") . $this->table;
87
+        $this->quotedTable = ($this->schema ? "{$driver->quoteIdentifier($this->schema)}." : "").$driver->quoteIdentifier($this->table);
88
+        $this->unquotedTable = ($this->schema ? "{$this->schema}." : "").$this->table;
89 89
         $this->adapter->setModel($this, $this->quotedTable);
90 90
         $this->initialized = true;
91 91
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     {
105 105
         $this->initialize();
106 106
         return $this->context->getCache()->read(
107
-                "{$this->className}::desc", function () {
107
+                "{$this->className}::desc", function() {
108 108
                 return $this->context->getModelDescription($this);
109 109
             }
110 110
         );
Please login to merge, or discard this patch.
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -171,6 +171,10 @@  discard block
 block discarded – undo
171 171
         return $this->retrieveItem($name);
172 172
     }
173 173
 
174
+    /**
175
+     * @param Relationship[] $relationships
176
+     * @param integer $depth
177
+     */
174 178
     private function expandArrayValue($array, $relationships, $depth, $index = null)
175 179
     {
176 180
         foreach ($relationships as $name => $relationship) {
@@ -359,6 +363,9 @@  discard block
 block discarded – undo
359 363
         
360 364
     }
361 365
 
366
+    /**
367
+     * @param string $id
368
+     */
362 369
     public function postSaveCallback($id)
363 370
     {
364 371
         
Please login to merge, or discard this patch.
src/interfaces/ValidatorFactoryInterface.php 1 patch
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -17,5 +17,10 @@
 block discarded – undo
17 17
  */
18 18
 interface ValidatorFactoryInterface
19 19
 {
20
+    /**
21
+     * @param integer $mode
22
+     *
23
+     * @return \ntentan\nibii\DefaultValidator
24
+     */
20 25
     public function createModelValidator(RecordWrapper $model, $mode);
21 26
 }
Please login to merge, or discard this patch.
src/interfaces/ModelFactoryInterface.php 1 patch
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -12,7 +12,17 @@
 block discarded – undo
12 12
 interface ModelFactoryInterface
13 13
 {
14 14
     public function createModel($name, $context);
15
+
16
+    /**
17
+     * @param \ntentan\nibii\RecordWrapper $instance
18
+     *
19
+     * @return string
20
+     */
15 21
     public function getModelTable($instance);
16 22
     public function getClassName($model);
23
+
24
+    /**
25
+     * @return string
26
+     */
17 27
     public function getJunctionClassName($classA, $classB);
18 28
 }
19 29
\ No newline at end of file
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
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
             $valueFields[] = ":{$field}";
33 33
         }
34 34
 
35
-        return "INSERT INTO " . $table .
36
-            " (" . implode(", ", $quotedFields) . ") VALUES (" . implode(', ', $valueFields) . ")";
35
+        return "INSERT INTO ".$table.
36
+            " (".implode(", ", $quotedFields).") VALUES (".implode(', ', $valueFields).")";
37 37
     }
38 38
 
39 39
     public function getBulkUpdateQuery($data, $parameters)
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
             }
77 77
         }
78 78
 
79
-        return "UPDATE " .
80
-            $model->getDBStoreInformation()['quoted_table'] .
81
-            " SET " . implode(', ', $valueFields) .
82
-            " WHERE " . implode(' AND ', $conditions);
79
+        return "UPDATE ".
80
+            $model->getDBStoreInformation()['quoted_table'].
81
+            " SET ".implode(', ', $valueFields).
82
+            " WHERE ".implode(' AND ', $conditions);
83 83
     }
84 84
 
85 85
     public function getSelectQuery($parameters)
Please login to merge, or discard this patch.
src/QueryParameters.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
127 127
 
128 128
     public function getSorts()
129 129
     {
130
-        return count($this->sorts) ? " ORDER BY " . implode(", ", $this->sorts) : null;
130
+        return count($this->sorts) ? " ORDER BY ".implode(", ", $this->sorts) : null;
131 131
     }
132 132
 
133 133
     public function addFilter($field, $values = null)
Please login to merge, or discard this patch.
src/DriverAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
     public function describe($model, $relationships)
114 114
     {
115 115
         return new ModelDescription(
116
-            $this->driver->describeTable($table)[$table], $relationships, function ($type) {
116
+            $this->driver->describeTable($table)[$table], $relationships, function($type) {
117 117
             return $this->mapDataTypes($type);
118 118
         }
119 119
         );
Please login to merge, or discard this patch.
src/QueryOperations.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,6 @@
 block discarded – undo
28 28
 
29 29
 use ntentan\atiaa\Driver;
30 30
 use ntentan\nibii\exceptions\ModelNotFoundException;
31
-use ntentan\nibii\exceptions\NibiiException;
32 31
 use ntentan\utils\Text;
33 32
 
34 33
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
     public function doFilter()
241 241
     {
242 242
         $arguments = func_get_args();
243
-        if(count($arguments) == 1 && is_array($arguments[0])) {
244
-            foreach($arguments[0] as $field => $value) {
243
+        if (count($arguments) == 1 && is_array($arguments[0])) {
244
+            foreach ($arguments[0] as $field => $value) {
245 245
                 $this->getQueryParameters()->addFilter($field, $value);
246 246
             }
247 247
         } else {
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 
350 350
     public function doWith($model)
351 351
     {
352
-        if(!isset($this->wrapper->getDescription()->getRelationships()[$model])) {
352
+        if (!isset($this->wrapper->getDescription()->getRelationships()[$model])) {
353 353
             throw new ModelNotFoundException("Could not find related model [$model]");
354 354
         }
355 355
         $relationship = $this->wrapper->getDescription()->getRelationships()[$model];
Please login to merge, or discard this patch.