Completed
Push — master ( be821e...418a4d )
by James Ekow Abaka
03:23
created
src/Context.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -56,6 +56,9 @@  discard block
 block discarded – undo
56 56
             ->getJunctionClassName($classA, $classB);
57 57
     }
58 58
 
59
+    /**
60
+     * @param RecordWrapper $instance
61
+     */
59 62
     public function getModelTable($instance) {
60 63
         return$this->container->singleton(interfaces\TableNameResolverInterface::class)
61 64
             ->getTableName($instance);
@@ -66,6 +69,9 @@  discard block
 block discarded – undo
66 69
             ->getModelClassName($model, $context);
67 70
     }
68 71
 
72
+    /**
73
+     * @param string $class
74
+     */
69 75
     public function getModelName($class) {
70 76
         return $class;
71 77
     }
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace ntentan\nibii;
4 4
 
5
-use ntentan\panie\Container;
6
-use ntentan\kaikai\Cache;
7 5
 use ntentan\atiaa\DbContext;
6
+use ntentan\kaikai\Cache;
7
+use ntentan\panie\Container;
8 8
 
9 9
 /**
10 10
  * A collection of utility methods used as helpers for loading
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@
 block discarded – undo
21 21
         $this->container = $container;
22 22
         $this->dbContext = $container->resolve(DbContext::class);
23 23
         $this->container->bind(interfaces\ModelJoinerInterface::class)
24
-             ->to(Resolver::class);
24
+                ->to(Resolver::class);
25 25
         $this->container->bind(interfaces\TableNameResolverInterface::class)
26
-             ->to(Resolver::class);
26
+                ->to(Resolver::class);
27 27
         $this->container->bind(interfaces\ModelClassResolverInterface::class)
28
-             ->to(Resolver::class);
28
+                ->to(Resolver::class);
29 29
         $this->cache = $this->container->resolve(Cache::class);
30 30
         self::$instance = $this;
31 31
     }
Please login to merge, or discard this patch.
src/DataOperations.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,6 @@
 block discarded – undo
26 26
 
27 27
 namespace ntentan\nibii;
28 28
 
29
-use ntentan\atiaa\Db;
30
-
31 29
 /**
32 30
  * Description of DataOperations
33 31
  *
Please login to merge, or discard this patch.
src/DriverAdapter.php 2 patches
Doc Comments   +13 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     /**
42 42
      * 
43 43
      * 
44
-     * @param type $parameters
44
+     * @param QueryParameters $parameters
45 45
      * @return type
46 46
      */
47 47
     public function select($parameters) {
@@ -57,6 +57,9 @@  discard block
 block discarded – undo
57 57
         return $result;
58 58
     }
59 59
 
60
+    /**
61
+     * @param QueryParameters $parameters
62
+     */
60 63
     public function count($parameters) {
61 64
         $result = $this->driver->query(
62 65
             $this->getQueryEngine()->getCountQuery($parameters), $parameters->getBoundData()
@@ -87,12 +90,18 @@  discard block
 block discarded – undo
87 90
         return $this->driver->query($this->updateQuery, $record);
88 91
     }
89 92
 
93
+    /**
94
+     * @param QueryParameters $parameters
95
+     */
90 96
     public function bulkUpdate($data, $parameters) {
91 97
         return $this->driver->query(
92 98
             $this->getQueryEngine()->getBulkUpdateQuery($data, $parameters), array_merge($data, $parameters->getBoundData())
93 99
         );
94 100
     }
95 101
 
102
+    /**
103
+     * @param QueryParameters $parameters
104
+     */
96 105
     public function delete($parameters) {
97 106
         return $this->driver->query(
98 107
             $this->getQueryEngine()->getDeleteQuery($parameters), $parameters->getBoundData()
@@ -119,6 +128,9 @@  discard block
 block discarded – undo
119 128
         return $this->queryEngine;
120 129
     }
121 130
 
131
+    /**
132
+     * @param RecordWrapper $model
133
+     */
122 134
     public function setModel($model) {
123 135
         $this->modelInstance = $model;
124 136
     }
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace ntentan\nibii;
4 4
 
5
-use ntentan\utils\Text;
6
-use ntentan\atiaa\Db;
7
-
8 5
 /**
9 6
  * A DriverAdaptr is a generic database adapter.
10 7
  * This adapter implements a lot of its operations through the atiaa library.
Please login to merge, or discard this patch.
src/ModelDescription.php 1 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\atiaa\Db;
6
-
7 5
 class ModelDescription {
8 6
 
9 7
     private $fields = [];
Please login to merge, or discard this patch.
src/QueryOperations.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
     /**
52 52
      * 
53 53
      * @param RecordWrapper $wrapper
54
-     * @param DataAdapter $adapter
54
+     * @param DriverAdapter $adapter
55 55
      * @param DataOperations $dataOperations
56 56
      */
57 57
     public function __construct(Context $context, RecordWrapper $wrapper, DriverAdapter $adapter, $dataOperations) {
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,6 @@
 block discarded – undo
27 27
 namespace ntentan\nibii;
28 28
 
29 29
 use ntentan\utils\Text;
30
-use ntentan\atiaa\Db;
31
-use ntentan\panie\Container;
32 30
 
33 31
 class QueryOperations {
34 32
 
Please login to merge, or discard this patch.
src/QueryParameters.php 1 patch
Doc Comments   +7 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     /**
24 24
      *
25
-     * @param \ $model
25
+     * @param string $table
26 26
      */
27 27
     public function __construct($table) {
28 28
         $this->table = $table;
@@ -104,6 +104,9 @@  discard block
 block discarded – undo
104 104
         $this->boundData += $values;
105 105
     }
106 106
 
107
+    /**
108
+     * @param boolean $firstOnly
109
+     */
107 110
     public function setFirstOnly($firstOnly) {
108 111
         $this->firstOnly = $firstOnly;
109 112
         return $this;
@@ -121,6 +124,9 @@  discard block
 block discarded – undo
121 124
         $this->offset = $offset;
122 125
     }
123 126
 
127
+    /**
128
+     * @param string $field
129
+     */
124 130
     public function addSort($field, $direction = 'ASC') {
125 131
         $this->sorts[] = "$field $direction";
126 132
     }
Please login to merge, or discard this patch.
src/RecordWrapper.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -26,9 +26,7 @@
 block discarded – undo
26 26
 
27 27
 namespace ntentan\nibii;
28 28
 
29
-use ntentan\kaikai\Cache;
30 29
 use ntentan\utils\Text;
31
-use ntentan\atiaa\Db;
32 30
 
33 31
 /**
34 32
  * 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
             $this->quotedTable = $driver->quoteIdentifier($table);
65 65
             $this->table = $this->unquotedTable = $table;
66 66
         } else {
67
-            $this->quotedTable = ( isset($table['schema']) ? "{$driver->quoteIdentifier($table["schema"])}." : "") . $driver->quoteIdentifier($table["table"]);
68
-            $this->unquotedTable = (isset($table['schema']) ? "{$table['schema']}." : "") . $table['table'];
67
+            $this->quotedTable = (isset($table['schema']) ? "{$driver->quoteIdentifier($table["schema"])}." : "").$driver->quoteIdentifier($table["table"]);
68
+            $this->unquotedTable = (isset($table['schema']) ? "{$table['schema']}." : "").$table['table'];
69 69
             $this->table = $table['table'];
70 70
             $this->schema = $table['schema'];
71 71
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function getDescription() {
85 85
         return $this->context->getCache()->read(
86
-            (new \ReflectionClass($this))->getName() . '::desc', function() {
86
+            (new \ReflectionClass($this))->getName().'::desc', function() {
87 87
                 return $this->container->resolve(ModelDescription::class, ['model' => $this]);
88 88
             }
89 89
         );
Please login to merge, or discard this patch.
src/Relationship.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,6 @@
 block discarded – undo
26 26
 
27 27
 namespace ntentan\nibii;
28 28
 
29
-use ntentan\panie\InjectionContainer;
30
-
31 29
 abstract class Relationship {
32 30
 
33 31
     const BELONGS_TO = 'BelongsTo';
Please login to merge, or discard this patch.
src/relationships/BelongsToRelationship.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
             $this->options['foreign_key'] = $model->getDescription()->getPrimaryKey()[0];
54 54
         }
55 55
         if ($this->options['local_key'] == null) {
56
-            $this->options['local_key'] = Text::singularize($table) . '_id';
56
+            $this->options['local_key'] = Text::singularize($table).'_id';
57 57
         }
58 58
     }
59 59
 
Please login to merge, or discard this patch.