@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @param int $fetchStyle the PDO fetch style |
| 96 | 96 | * @return array<int, mixed>|false |
| 97 | 97 | */ |
| 98 | - public function all(?callable $callable = null, int $fetchStyle = 0): array|false |
|
| 98 | + public function all(?callable $callable = null, int $fetchStyle = 0): array | false |
|
| 99 | 99 | { |
| 100 | 100 | if ($callable === null) { |
| 101 | 101 | return $this->statement->fetchAll($fetchStyle); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @param callable|null $callable |
| 110 | 110 | * @return array<int, mixed>|false |
| 111 | 111 | */ |
| 112 | - public function allGroup(bool $uniq = false, ?callable $callable = null): array|false |
|
| 112 | + public function allGroup(bool $uniq = false, ?callable $callable = null): array | false |
|
| 113 | 113 | { |
| 114 | 114 | $fetchStyle = PDO::FETCH_GROUP | ($uniq ? PDO::FETCH_UNIQUE : 0); |
| 115 | 115 | |
@@ -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 | |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | * @param string|array<string> $tables Table name or an array of tables |
| 124 | 124 | * @return QueryCommand |
| 125 | 125 | */ |
| 126 | - public function from(string|array $tables): QueryCommand |
|
| 126 | + public function from(string | array $tables): QueryCommand |
|
| 127 | 127 | { |
| 128 | 128 | return new QueryCommand($this->connection, $tables); |
| 129 | 129 | } |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | * @class QueryBuilder |
| 56 | 56 | * @package Platine\Database |
| 57 | 57 | */ |
| 58 | -class QueryBuilder |
|
| 59 | -{ |
|
| 58 | +class QueryBuilder { |
|
| 60 | 59 | /** |
| 61 | 60 | * The Connection instance |
| 62 | 61 | * @var Connection |
@@ -73,8 +72,7 @@ discard block |
||
| 73 | 72 | * Class constructor |
| 74 | 73 | * @param Connection $connection |
| 75 | 74 | */ |
| 76 | - public function __construct(Connection $connection) |
|
| 77 | - { |
|
| 75 | + public function __construct(Connection $connection) { |
|
| 78 | 76 | $this->connection = $connection; |
| 79 | 77 | $this->schema = $this->connection->getSchema(); |
| 80 | 78 | } |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | is_array($config['connections']) && |
| 79 | 79 | count($config['connections']) > 0 |
| 80 | 80 | ) { |
| 81 | - /** @var array<string, array<string, mixed>> $connections */ |
|
| 81 | + /** @var array<string, array<string, mixed>> $connections */ |
|
| 82 | 82 | $connections = $config['connections']; |
| 83 | 83 | |
| 84 | 84 | foreach ($connections as $name => $connection) { |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * @class Pool |
| 54 | 54 | * @package Platine\Database |
| 55 | 55 | */ |
| 56 | -class Pool |
|
| 57 | -{ |
|
| 56 | +class Pool { |
|
| 58 | 57 | /** |
| 59 | 58 | * The default connection name |
| 60 | 59 | * @var string |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | * Class constructor |
| 72 | 71 | * @param array<string, mixed> $config |
| 73 | 72 | */ |
| 74 | - public function __construct(array $config = []) |
|
| 75 | - { |
|
| 73 | + public function __construct(array $config = []) { |
|
| 76 | 74 | if (count($config) > 0) { |
| 77 | 75 | if ( |
| 78 | 76 | is_array($config['connections']) && |
@@ -61,8 +61,7 @@ |
||
| 61 | 61 | * @class Connection |
| 62 | 62 | * @package Platine\Database |
| 63 | 63 | */ |
| 64 | -class Connection |
|
| 65 | -{ |
|
| 64 | +class Connection { |
|
| 66 | 65 | /** |
| 67 | 66 | * The PDO instance |
| 68 | 67 | * @var PDO |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * @class ConnectionStatement |
| 53 | 53 | * @package Platine\Database |
| 54 | 54 | */ |
| 55 | -class ConnectionStatement extends PDOStatement |
|
| 56 | -{ |
|
| 55 | +class ConnectionStatement extends PDOStatement { |
|
| 57 | 56 | /** |
| 58 | 57 | * {@inheritdoc} |
| 59 | 58 | */ |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | * @param string|null $name |
| 200 | 200 | * @return $this |
| 201 | 201 | */ |
| 202 | - public function primary(string|array $columns, ?string $name = null): self |
|
| 202 | + public function primary(string | array $columns, ?string $name = null): self |
|
| 203 | 203 | { |
| 204 | 204 | if (!is_array($columns)) { |
| 205 | 205 | $columns = [$columns]; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | * @param string|null $name |
| 224 | 224 | * @return $this |
| 225 | 225 | */ |
| 226 | - public function unique(string|array $columns, ?string $name = null): self |
|
| 226 | + public function unique(string | array $columns, ?string $name = null): self |
|
| 227 | 227 | { |
| 228 | 228 | if (!is_array($columns)) { |
| 229 | 229 | $columns = [$columns]; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | * @param string|null $name |
| 245 | 245 | * @return $this |
| 246 | 246 | */ |
| 247 | - public function index(string|array $columns, ?string $name = null): self |
|
| 247 | + public function index(string | array $columns, ?string $name = null): self |
|
| 248 | 248 | { |
| 249 | 249 | if (!is_array($columns)) { |
| 250 | 250 | $columns = [$columns]; |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | * @param string|null $name |
| 266 | 266 | * @return ForeignKey |
| 267 | 267 | */ |
| 268 | - public function foreign(string|array $columns, ?string $name = null): ForeignKey |
|
| 268 | + public function foreign(string | array $columns, ?string $name = null): ForeignKey |
|
| 269 | 269 | { |
| 270 | 270 | if (!is_array($columns)) { |
| 271 | 271 | $columns = [$columns]; |
@@ -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 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @param string|null $name |
| 172 | 172 | * @return $this |
| 173 | 173 | */ |
| 174 | - public function primary(string|array $columns, ?string $name = null): self |
|
| 174 | + public function primary(string | array $columns, ?string $name = null): self |
|
| 175 | 175 | { |
| 176 | 176 | return $this->addKey('addPrimary', $columns, $name); |
| 177 | 177 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @param string|null $name |
| 183 | 183 | * @return $this |
| 184 | 184 | */ |
| 185 | - public function unique(string|array $columns, ?string $name = null): self |
|
| 185 | + public function unique(string | array $columns, ?string $name = null): self |
|
| 186 | 186 | { |
| 187 | 187 | return $this->addKey('addUnique', $columns, $name); |
| 188 | 188 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | * @param string|null $name |
| 194 | 194 | * @return $this |
| 195 | 195 | */ |
| 196 | - public function index(string|array $columns, ?string $name = null): self |
|
| 196 | + public function index(string | array $columns, ?string $name = null): self |
|
| 197 | 197 | { |
| 198 | 198 | return $this->addKey('addIndex', $columns, $name); |
| 199 | 199 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * @param string|null $name |
| 205 | 205 | * @return ForeignKey |
| 206 | 206 | */ |
| 207 | - public function foreign(string|array $columns, ?string $name = null): ForeignKey |
|
| 207 | + public function foreign(string | array $columns, ?string $name = null): ForeignKey |
|
| 208 | 208 | { |
| 209 | 209 | if (!is_array($columns)) { |
| 210 | 210 | $columns = [$columns]; |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | * @param string|null $name |
| 567 | 567 | * @return $this |
| 568 | 568 | */ |
| 569 | - protected function addKey(string $type, string|array $columns, ?string $name = null): self |
|
| 569 | + protected function addKey(string $type, string | array $columns, ?string $name = null): self |
|
| 570 | 570 | { |
| 571 | 571 | static $maps = [ |
| 572 | 572 | 'addPrimary' => 'pk', |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | * @class BaseColumn |
| 51 | 51 | * @package Platine\Database\Schema |
| 52 | 52 | */ |
| 53 | -class BaseColumn |
|
| 54 | -{ |
|
| 53 | +class BaseColumn { |
|
| 55 | 54 | /** |
| 56 | 55 | * The name of the column |
| 57 | 56 | * @var string |
@@ -75,8 +74,7 @@ discard block |
||
| 75 | 74 | * @param string $name |
| 76 | 75 | * @param string|null $type |
| 77 | 76 | */ |
| 78 | - public function __construct(string $name, ?string $type = null) |
|
| 79 | - { |
|
| 77 | + public function __construct(string $name, ?string $type = null) { |
|
| 80 | 78 | $this->name = $name; |
| 81 | 79 | $this->type = $type; |
| 82 | 80 | } |
@@ -151,8 +149,7 @@ discard block |
||
| 151 | 149 | * @param mixed $default |
| 152 | 150 | * @return mixed |
| 153 | 151 | */ |
| 154 | - public function get(string $name, mixed $default = null) |
|
| 155 | - { |
|
| 152 | + public function get(string $name, mixed $default = null) { |
|
| 156 | 153 | return isset($this->properties[$name]) |
| 157 | 154 | ? $this->properties[$name] |
| 158 | 155 | : $default; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function __construct( |
| 70 | 70 | Connection $connection, |
| 71 | - string|array $from, |
|
| 71 | + string | array $from, |
|
| 72 | 72 | ?QueryStatement $queryStatement = null |
| 73 | 73 | ) { |
| 74 | 74 | parent::__construct($from, $queryStatement); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @return int |
| 84 | 84 | * @throws QueryException |
| 85 | 85 | */ |
| 86 | - public function delete(string|array $tables = []): int |
|
| 86 | + public function delete(string | array $tables = []): int |
|
| 87 | 87 | { |
| 88 | 88 | parent::delete($tables); |
| 89 | 89 | $driver = $this->connection->getDriver(); |
@@ -53,8 +53,7 @@ |
||
| 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 | * @var Connection |
| 60 | 59 | */ |