Passed
Push — develop ( d633c2...348aa2 )
by nguereza
04:37
created
src/ResultSet.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
  * Class ResultSet
55 55
  * @package Platine\Database
56 56
  */
57
-class ResultSet
58
-{
57
+class ResultSet {
59 58
 
60 59
     /**
61 60
      * The PDOStatement instance
@@ -67,8 +66,7 @@  discard block
 block discarded – undo
67 66
      * Class constructor
68 67
      * @param PDOStatement $statement
69 68
      */
70
-    public function __construct(PDOStatement $statement)
71
-    {
69
+    public function __construct(PDOStatement $statement) {
72 70
         $this->statement = $statement;
73 71
     }
74 72
 
@@ -76,8 +74,7 @@  discard block
 block discarded – undo
76 74
      * Destructor of the class
77 75
      *
78 76
      */
79
-    public function __destruct()
80
-    {
77
+    public function __destruct() {
81 78
         $this->statement->closeCursor();
82 79
     }
83 80
 
@@ -96,8 +93,7 @@  discard block
 block discarded – undo
96 93
      * @param int $fetchStyle the PDO fetch style
97 94
      * @return array<int, mixed>|false
98 95
      */
99
-    public function all(callable $callable = null, int $fetchStyle = 0)
100
-    {
96
+    public function all(callable $callable = null, int $fetchStyle = 0) {
101 97
         if ($callable === null) {
102 98
             return $this->statement->fetchAll($fetchStyle);
103 99
         }
@@ -110,8 +106,7 @@  discard block
 block discarded – undo
110 106
      * @param callable $callable
111 107
      * @return array<int, mixed>|false
112 108
      */
113
-    public function allGroup(bool $uniq = false, callable $callable = null)
114
-    {
109
+    public function allGroup(bool $uniq = false, callable $callable = null) {
115 110
         $fetchStyle = PDO::FETCH_GROUP | ($uniq ? PDO::FETCH_UNIQUE : 0);
116 111
 
117 112
         if ($callable === null) {
@@ -125,8 +120,7 @@  discard block
 block discarded – undo
125 120
      * @param callable $callable
126 121
      * @return mixed
127 122
      */
128
-    public function get(callable $callable = null)
129
-    {
123
+    public function get(callable $callable = null) {
130 124
         $result = $this->statement->fetch();
131 125
         $this->statement->closeCursor();
132 126
         if ($callable !== null) {
@@ -141,8 +135,7 @@  discard block
 block discarded – undo
141 135
      *
142 136
      * @return mixed
143 137
      */
144
-    public function next()
145
-    {
138
+    public function next() {
146 139
         return $this->statement->fetch();
147 140
     }
148 141
 
@@ -150,8 +143,7 @@  discard block
 block discarded – undo
150 143
      * Close the cursor
151 144
      * @return mixed
152 145
      */
153
-    public function flush()
154
-    {
146
+    public function flush() {
155 147
         return $this->statement->closeCursor();
156 148
     }
157 149
 
@@ -161,8 +153,7 @@  discard block
 block discarded – undo
161 153
      *
162 154
      * @return mixed
163 155
      */
164
-    public function column(int $col = 0)
165
-    {
156
+    public function column(int $col = 0) {
166 157
         return $this->statement->fetchColumn($col);
167 158
     }
168 159
 
Please login to merge, or discard this patch.
src/Connection.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -133,9 +133,9 @@
 block discarded – undo
133 133
     }
134 134
 
135 135
         /**
136
-     * Connect to the database
137
-     * @return void
138
-     */
136
+         * Connect to the database
137
+         * @return void
138
+         */
139 139
     public function connect(): void
140 140
     {
141 141
         $this->setConnectionParams();
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -376,7 +376,7 @@
 block discarded – undo
376 376
 
377 377
         return (string) preg_replace_callback(
378 378
             '/\?/',
379
-            function () use ($driver, &$params) {
379
+            function() use ($driver, &$params) {
380 380
                 $param = array_shift($params);
381 381
 
382 382
                 $value = is_object($param) ? get_class($param) : $param;
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
  * Class Connection
61 61
  * @package Platine\Database
62 62
  */
63
-class Connection
64
-{
63
+class Connection {
65 64
 
66 65
     /**
67 66
      * The PDO instance
@@ -322,8 +321,7 @@  discard block
 block discarded – undo
322 321
      * @return mixed
323 322
      * @throws QueryException
324 323
      */
325
-    public function column(string $sql, array $params = [])
326
-    {
324
+    public function column(string $sql, array $params = []) {
327 325
         $prepared = $this->prepare($sql, $params);
328 326
         $this->execute($prepared);
329 327
 
Please login to merge, or discard this patch.
src/Schema/BaseColumn.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
  * Class BaseColumn
51 51
  * @package Platine\Database\Schema
52 52
  */
53
-class BaseColumn
54
-{
53
+class BaseColumn {
55 54
 
56 55
     /**
57 56
      * The name of the column
@@ -76,8 +75,7 @@  discard block
 block discarded – undo
76 75
      * @param string $name
77 76
      * @param string|null $type
78 77
      */
79
-    public function __construct(string $name, ?string $type = null)
80
-    {
78
+    public function __construct(string $name, ?string $type = null) {
81 79
         $this->name = $name;
82 80
         $this->type = $type;
83 81
     }
@@ -152,8 +150,7 @@  discard block
 block discarded – undo
152 150
      * @param mixed|null $default
153 151
      * @return mixed
154 152
      */
155
-    public function get(string $name, $default = null)
156
-    {
153
+    public function get(string $name, $default = null) {
157 154
         return isset($this->properties[$name]) ? $this->properties[$name] : $default;
158 155
     }
159 156
 
Please login to merge, or discard this patch.
src/Schema/ForeignKey.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
  * Class ForeignKey
51 51
  * @package Platine\Database\Schema
52 52
  */
53
-class ForeignKey
54
-{
53
+class ForeignKey {
55 54
 
56 55
     /**
57 56
      * The referenced table
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
      * Class constructor
82 81
      * @param array<int, string> $columns
83 82
      */
84
-    public function __construct(array $columns)
85
-    {
83
+    public function __construct(array $columns) {
86 84
         $this->columns = $columns;
87 85
     }
88 86
 
Please login to merge, or discard this patch.
src/Configuration.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
  * Class Configuration
59 59
  * @package Platine\Database
60 60
  */
61
-class Configuration implements ConfigurationInterface
62
-{
61
+class Configuration implements ConfigurationInterface {
63 62
     /**
64 63
      * The connection driver to use
65 64
      * @var string
@@ -159,8 +158,7 @@  discard block
 block discarded – undo
159 158
      * Class constructor
160 159
      * @param array<string, mixed> $config the connection configuration
161 160
      */
162
-    public function __construct(array $config = [])
163
-    {
161
+    public function __construct(array $config = []) {
164 162
         $this->load($config);
165 163
     }
166 164
 
@@ -291,8 +289,7 @@  discard block
 block discarded – undo
291 289
     /**
292 290
      * {@inheritedoc}
293 291
      */
294
-    public function getAttribute(string $name, $default = null)
295
-    {
292
+    public function getAttribute(string $name, $default = null) {
296 293
         return $this->hasAttribute($name)
297 294
                        ? $this->attributes[$name]
298 295
                        : $default;
Please login to merge, or discard this patch.
src/ConfigurationInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
  * Interface ConfigurationInterface
51 51
  * @package Platine\Database
52 52
  */
53
-interface ConfigurationInterface
54
-{
53
+interface ConfigurationInterface {
55 54
 
56 55
     /**
57 56
      *
Please login to merge, or discard this patch.
src/Query/Having.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
  * Class Having
53 53
  * @package Platine\Database\Query
54 54
  */
55
-class Having
56
-{
55
+class Having {
57 56
 
58 57
     /**
59 58
      * @var string|Expression
@@ -75,8 +74,7 @@  discard block
 block discarded – undo
75 74
      * Having constructor.
76 75
      * @param QueryStatement $queryStatement
77 76
      */
78
-    public function __construct(QueryStatement $queryStatement)
79
-    {
77
+    public function __construct(QueryStatement $queryStatement) {
80 78
         $this->queryStatement = $queryStatement;
81 79
     }
82 80
 
@@ -227,8 +225,7 @@  discard block
 block discarded – undo
227 225
     /**
228 226
      * @inheritDoc
229 227
      */
230
-    public function __clone()
231
-    {
228
+    public function __clone() {
232 229
         if ($this->aggregate instanceof Expression) {
233 230
             $this->aggregate = clone $this->aggregate;
234 231
         }
Please login to merge, or discard this patch.
src/Query/Delete.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
  * Class Delete
54 54
  * @package Platine\Database\Query
55 55
  */
56
-class Delete extends DeleteStatement
57
-{
56
+class Delete extends DeleteStatement {
58 57
 
59 58
     /**
60 59
      * @var Connection
@@ -67,8 +66,7 @@  discard block
 block discarded – undo
67 66
      * @param string|array<string> $from
68 67
      * @param QueryStatement|null $queryStatement
69 68
      */
70
-    public function __construct(Connection $connection, $from, QueryStatement $queryStatement = null)
71
-    {
69
+    public function __construct(Connection $connection, $from, QueryStatement $queryStatement = null) {
72 70
         parent::__construct($from, $queryStatement);
73 71
 
74 72
         $this->connection = $connection;
Please login to merge, or discard this patch.
src/Query/Select.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
  * Class Select
55 55
  * @package Platine\Database\Query
56 56
  */
57
-class Select extends SelectStatement
58
-{
57
+class Select extends SelectStatement {
59 58
 
60 59
     /**
61 60
      * @var Connection
@@ -82,8 +81,7 @@  discard block
 block discarded – undo
82 81
      *
83 82
      * @return ResultSet
84 83
      */
85
-    public function select($columns = [])
86
-    {
84
+    public function select($columns = []) {
87 85
         parent::select($columns);
88 86
         $driver = $this->connection->getDriver();
89 87
 
@@ -98,8 +96,7 @@  discard block
 block discarded – undo
98 96
      *
99 97
      * @return mixed|false
100 98
      */
101
-    public function column($name)
102
-    {
99
+    public function column($name) {
103 100
         parent::column($name);
104 101
         return $this->getColumnResultSet();
105 102
     }
@@ -122,8 +119,7 @@  discard block
 block discarded – undo
122 119
      *
123 120
      * @return int|float
124 121
      */
125
-    public function avg($column, bool $distinct = false)
126
-    {
122
+    public function avg($column, bool $distinct = false) {
127 123
         parent::avg($column, $distinct);
128 124
         return $this->getColumnResultSet();
129 125
     }
@@ -134,8 +130,7 @@  discard block
 block discarded – undo
134 130
      *
135 131
      * @return int|float
136 132
      */
137
-    public function sum($column, bool $distinct = false)
138
-    {
133
+    public function sum($column, bool $distinct = false) {
139 134
         parent::sum($column, $distinct);
140 135
         return $this->getColumnResultSet();
141 136
     }
@@ -146,8 +141,7 @@  discard block
 block discarded – undo
146 141
      *
147 142
      * @return int|float
148 143
      */
149
-    public function min($column, bool $distinct = false)
150
-    {
144
+    public function min($column, bool $distinct = false) {
151 145
         parent::min($column, $distinct);
152 146
         return $this->getColumnResultSet();
153 147
     }
@@ -158,8 +152,7 @@  discard block
 block discarded – undo
158 152
      *
159 153
      * @return int|float
160 154
      */
161
-    public function max($column, bool $distinct = false)
162
-    {
155
+    public function max($column, bool $distinct = false) {
163 156
         parent::max($column, $distinct);
164 157
         return $this->getColumnResultSet();
165 158
     }
@@ -168,8 +161,7 @@  discard block
 block discarded – undo
168 161
      * Return the result set for column
169 162
      * @return mixed
170 163
      */
171
-    protected function getColumnResultSet()
172
-    {
164
+    protected function getColumnResultSet() {
173 165
         $driver = $this->connection->getDriver();
174 166
 
175 167
         return $this->connection->column(
Please login to merge, or discard this patch.