@@ -50,16 +50,14 @@ discard block |
||
50 | 50 | * Class DeleteStatement |
51 | 51 | * @package Platine\Database\Query |
52 | 52 | */ |
53 | -class DeleteStatement extends BaseStatement |
|
54 | -{ |
|
53 | +class DeleteStatement extends BaseStatement { |
|
55 | 54 | |
56 | 55 | /** |
57 | 56 | * DeleteStatement constructor. |
58 | 57 | * @param string|array<string> $from |
59 | 58 | * @param QueryStatement|null $queryStatement |
60 | 59 | */ |
61 | - public function __construct($from, QueryStatement $queryStatement = null) |
|
62 | - { |
|
60 | + public function __construct($from, QueryStatement $queryStatement = null) { |
|
63 | 61 | parent::__construct($queryStatement); |
64 | 62 | |
65 | 63 | if (!is_array($from)) { |
@@ -73,8 +71,7 @@ discard block |
||
73 | 71 | * @param string|array<string> $tables |
74 | 72 | * @return mixed |
75 | 73 | */ |
76 | - public function delete($tables = []) |
|
77 | - { |
|
74 | + public function delete($tables = []) { |
|
78 | 75 | if (!is_array($tables)) { |
79 | 76 | /** @var array<string> $tables */ |
80 | 77 | $tables = [$tables]; |
@@ -38,6 +38,5 @@ |
||
38 | 38 | * Class ConnectionNotFoundException |
39 | 39 | * @package Platine\Database\Exception |
40 | 40 | */ |
41 | -class ConnectionNotFoundException extends Exception |
|
42 | -{ |
|
41 | +class ConnectionNotFoundException extends Exception { |
|
43 | 42 | } |
@@ -38,6 +38,5 @@ |
||
38 | 38 | * Class ConnectionAlreadyExistsException |
39 | 39 | * @package Platine\Database\Exception |
40 | 40 | */ |
41 | -class ConnectionAlreadyExistsException extends Exception |
|
42 | -{ |
|
41 | +class ConnectionAlreadyExistsException extends Exception { |
|
43 | 42 | } |
@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | * Class Configuration |
60 | 60 | * @package Platine\Database |
61 | 61 | */ |
62 | -class Configuration extends AbstractConfiguration |
|
63 | -{ |
|
62 | +class Configuration extends AbstractConfiguration { |
|
64 | 63 | /** |
65 | 64 | * The connection driver to use |
66 | 65 | * @var string |
@@ -350,8 +349,7 @@ discard block |
||
350 | 349 | * |
351 | 350 | * @return mixed |
352 | 351 | */ |
353 | - public function getAttribute(string $name, $default = null) |
|
354 | - { |
|
352 | + public function getAttribute(string $name, $default = null) { |
|
355 | 353 | return $this->hasAttribute($name) |
356 | 354 | ? $this->attributes[$name] |
357 | 355 | : $default; |
@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | * Class ResultSet |
55 | 55 | * @package Platine\Database |
56 | 56 | */ |
57 | -class ResultSet |
|
58 | -{ |
|
57 | +class ResultSet { |
|
59 | 58 | /** |
60 | 59 | * The PDOStatement instance |
61 | 60 | * @var PDOStatement |
@@ -66,8 +65,7 @@ discard block |
||
66 | 65 | * Class constructor |
67 | 66 | * @param PDOStatement $statement |
68 | 67 | */ |
69 | - public function __construct(PDOStatement $statement) |
|
70 | - { |
|
68 | + public function __construct(PDOStatement $statement) { |
|
71 | 69 | $this->statement = $statement; |
72 | 70 | } |
73 | 71 | |
@@ -75,8 +73,7 @@ discard block |
||
75 | 73 | * Destructor of the class |
76 | 74 | * |
77 | 75 | */ |
78 | - public function __destruct() |
|
79 | - { |
|
76 | + public function __destruct() { |
|
80 | 77 | $this->statement->closeCursor(); |
81 | 78 | } |
82 | 79 | |
@@ -95,8 +92,7 @@ discard block |
||
95 | 92 | * @param int $fetchStyle the PDO fetch style |
96 | 93 | * @return array<int, mixed>|false |
97 | 94 | */ |
98 | - public function all(callable $callable = null, int $fetchStyle = 0) |
|
99 | - { |
|
95 | + public function all(callable $callable = null, int $fetchStyle = 0) { |
|
100 | 96 | if ($callable === null) { |
101 | 97 | return $this->statement->fetchAll($fetchStyle); |
102 | 98 | } |
@@ -109,8 +105,7 @@ discard block |
||
109 | 105 | * @param callable $callable |
110 | 106 | * @return array<int, mixed>|false |
111 | 107 | */ |
112 | - public function allGroup(bool $uniq = false, callable $callable = null) |
|
113 | - { |
|
108 | + public function allGroup(bool $uniq = false, callable $callable = null) { |
|
114 | 109 | $fetchStyle = PDO::FETCH_GROUP | ($uniq ? PDO::FETCH_UNIQUE : 0); |
115 | 110 | |
116 | 111 | if ($callable === null) { |
@@ -124,8 +119,7 @@ discard block |
||
124 | 119 | * @param callable $callable |
125 | 120 | * @return mixed |
126 | 121 | */ |
127 | - public function get(callable $callable = null) |
|
128 | - { |
|
122 | + public function get(callable $callable = null) { |
|
129 | 123 | $result = $this->statement->fetch(); |
130 | 124 | $this->statement->closeCursor(); |
131 | 125 | if ($callable !== null) { |
@@ -140,8 +134,7 @@ discard block |
||
140 | 134 | * |
141 | 135 | * @return mixed |
142 | 136 | */ |
143 | - public function next() |
|
144 | - { |
|
137 | + public function next() { |
|
145 | 138 | return $this->statement->fetch(); |
146 | 139 | } |
147 | 140 | |
@@ -149,8 +142,7 @@ discard block |
||
149 | 142 | * Close the cursor |
150 | 143 | * @return mixed |
151 | 144 | */ |
152 | - public function flush() |
|
153 | - { |
|
145 | + public function flush() { |
|
154 | 146 | return $this->statement->closeCursor(); |
155 | 147 | } |
156 | 148 | |
@@ -160,8 +152,7 @@ discard block |
||
160 | 152 | * |
161 | 153 | * @return mixed |
162 | 154 | */ |
163 | - public function column(int $col = 0) |
|
164 | - { |
|
155 | + public function column(int $col = 0) { |
|
165 | 156 | return $this->statement->fetchColumn($col); |
166 | 157 | } |
167 | 158 |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | * Class AlterColumn |
51 | 51 | * @package Platine\Database\Schema |
52 | 52 | */ |
53 | -class AlterColumn extends BaseColumn |
|
54 | -{ |
|
53 | +class AlterColumn extends BaseColumn { |
|
55 | 54 | /** |
56 | 55 | * The alter table |
57 | 56 | * @var AlterTable |
@@ -64,8 +63,7 @@ discard block |
||
64 | 63 | * @param string $name |
65 | 64 | * @param string|null $type |
66 | 65 | */ |
67 | - public function __construct(AlterTable $table, string $name, ?string $type = null) |
|
68 | - { |
|
66 | + public function __construct(AlterTable $table, string $name, ?string $type = null) { |
|
69 | 67 | $this->table = $table; |
70 | 68 | parent::__construct($name, $type); |
71 | 69 | } |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | * Class ForeignKey |
51 | 51 | * @package Platine\Database\Schema |
52 | 52 | */ |
53 | -class ForeignKey |
|
54 | -{ |
|
53 | +class ForeignKey { |
|
55 | 54 | /** |
56 | 55 | * The referenced table |
57 | 56 | * @var string |
@@ -80,8 +79,7 @@ discard block |
||
80 | 79 | * Class constructor |
81 | 80 | * @param array<int, string> $columns |
82 | 81 | */ |
83 | - public function __construct(array $columns) |
|
84 | - { |
|
82 | + public function __construct(array $columns) { |
|
85 | 83 | $this->columns = $columns; |
86 | 84 | } |
87 | 85 |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | * Class CreateTable |
51 | 51 | * @package Platine\Database\Schema |
52 | 52 | */ |
53 | -class CreateTable |
|
54 | -{ |
|
53 | +class CreateTable { |
|
55 | 54 | /** |
56 | 55 | * The list of CreateColumn |
57 | 56 | * @var array<string, CreateColumn> |
@@ -104,8 +103,7 @@ discard block |
||
104 | 103 | * Class constructor |
105 | 104 | * @param string $table |
106 | 105 | */ |
107 | - public function __construct(string $table) |
|
108 | - { |
|
106 | + public function __construct(string $table) { |
|
109 | 107 | $this->table = $table; |
110 | 108 | } |
111 | 109 | |
@@ -131,8 +129,7 @@ discard block |
||
131 | 129 | * |
132 | 130 | * @return mixed |
133 | 131 | */ |
134 | - public function getPrimaryKey() |
|
135 | - { |
|
132 | + public function getPrimaryKey() { |
|
136 | 133 | return $this->primaryKey; |
137 | 134 | } |
138 | 135 |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | * Class CreateColumn |
51 | 51 | * @package Platine\Database\Schema |
52 | 52 | */ |
53 | -class CreateColumn extends BaseColumn |
|
54 | -{ |
|
53 | +class CreateColumn extends BaseColumn { |
|
55 | 54 | /** |
56 | 55 | * The associated table instance |
57 | 56 | * @var CreateTable |
@@ -64,8 +63,7 @@ discard block |
||
64 | 63 | * @param string $name |
65 | 64 | * @param string|null $type |
66 | 65 | */ |
67 | - public function __construct(CreateTable $table, string $name, ?string $type = null) |
|
68 | - { |
|
66 | + public function __construct(CreateTable $table, string $name, ?string $type = null) { |
|
69 | 67 | $this->table = $table; |
70 | 68 | parent::__construct($name, $type); |
71 | 69 | } |