@@ -61,8 +61,7 @@ discard block |
||
| 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 |
@@ -346,8 +345,7 @@ discard block |
||
| 346 | 345 | * @return mixed |
| 347 | 346 | * @throws QueryException |
| 348 | 347 | */ |
| 349 | - public function column(string $sql, array $params = []) |
|
| 350 | - { |
|
| 348 | + public function column(string $sql, array $params = []) { |
|
| 351 | 349 | $prepared = $this->prepare($sql, $params); |
| 352 | 350 | $this->execute($prepared); |
| 353 | 351 | |
@@ -400,8 +398,7 @@ discard block |
||
| 400 | 398 | /** |
| 401 | 399 | * {@inheritdoc} |
| 402 | 400 | */ |
| 403 | - public function __sleep() |
|
| 404 | - { |
|
| 401 | + public function __sleep() { |
|
| 405 | 402 | return [ |
| 406 | 403 | 'dsn', |
| 407 | 404 | 'driver', |
@@ -415,8 +412,7 @@ discard block |
||
| 415 | 412 | /** |
| 416 | 413 | * {@inheritdoc} |
| 417 | 414 | */ |
| 418 | - public function __wakeup() |
|
| 419 | - { |
|
| 415 | + public function __wakeup() { |
|
| 420 | 416 | $this->createPDO(); |
| 421 | 417 | } |
| 422 | 418 | |
@@ -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 | } |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | * Class AlterTable |
| 51 | 51 | * @package Platine\Database\Schema |
| 52 | 52 | */ |
| 53 | -class AlterTable |
|
| 54 | -{ |
|
| 53 | +class AlterTable { |
|
| 55 | 54 | /** |
| 56 | 55 | * The name of table |
| 57 | 56 | * @var string |
@@ -68,8 +67,7 @@ discard block |
||
| 68 | 67 | * Class constructor |
| 69 | 68 | * @param string $table |
| 70 | 69 | */ |
| 71 | - public function __construct(string $table) |
|
| 72 | - { |
|
| 70 | + public function __construct(string $table) { |
|
| 73 | 71 | $this->table = $table; |
| 74 | 72 | } |
| 75 | 73 | |
@@ -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|null $default |
| 152 | 150 | * @return mixed |
| 153 | 151 | */ |
| 154 | - public function get(string $name, $default = null) |
|
| 155 | - { |
|
| 152 | + public function get(string $name, $default = null) { |
|
| 156 | 153 | return isset($this->properties[$name]) |
| 157 | 154 | ? $this->properties[$name] |
| 158 | 155 | : $default; |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * Class Schema |
| 54 | 54 | * @package Platine\Database |
| 55 | 55 | */ |
| 56 | -class Schema |
|
| 57 | -{ |
|
| 56 | +class Schema { |
|
| 58 | 57 | /** |
| 59 | 58 | * The Connection instance |
| 60 | 59 | * @var Connection |
@@ -83,8 +82,7 @@ discard block |
||
| 83 | 82 | * Class constructor |
| 84 | 83 | * @param Connection $connection |
| 85 | 84 | */ |
| 86 | - public function __construct(Connection $connection) |
|
| 87 | - { |
|
| 85 | + public function __construct(Connection $connection) { |
|
| 88 | 86 | $this->connection = $connection; |
| 89 | 87 | } |
| 90 | 88 | |