@@ -38,7 +38,6 @@ |
||
| 38 | 38 | * Class TransactionException |
| 39 | 39 | * @package Platine\Database\Exception |
| 40 | 40 | */ |
| 41 | -class TransactionException extends RuntimeException |
|
| 42 | -{ |
|
| 41 | +class TransactionException extends RuntimeException { |
|
| 43 | 42 | |
| 44 | 43 | } |
@@ -198,10 +198,10 @@ discard block |
||
| 198 | 198 | return $this->appname; |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - /** |
|
| 202 | - * Return the host |
|
| 203 | - * @return string |
|
| 204 | - */ |
|
| 201 | + /** |
|
| 202 | + * Return the host |
|
| 203 | + * @return string |
|
| 204 | + */ |
|
| 205 | 205 | public function getHostname(): string |
| 206 | 206 | { |
| 207 | 207 | return $this->hostname; |
@@ -399,12 +399,12 @@ discard block |
||
| 399 | 399 | public function getDriverClassName(): string |
| 400 | 400 | { |
| 401 | 401 | $maps = [ |
| 402 | - 'mysql' => MySQL::class, |
|
| 403 | - 'pgsql' => PostgreSQL::class, |
|
| 404 | - 'sqlsrv' => SQLServer::class, |
|
| 405 | - 'oci' => Oracle::class, |
|
| 406 | - 'oracle' => Oracle::class, |
|
| 407 | - 'sqlite' => SQLite::class, |
|
| 402 | + 'mysql' => MySQL::class, |
|
| 403 | + 'pgsql' => PostgreSQL::class, |
|
| 404 | + 'sqlsrv' => SQLServer::class, |
|
| 405 | + 'oci' => Oracle::class, |
|
| 406 | + 'oracle' => Oracle::class, |
|
| 407 | + 'sqlite' => SQLite::class, |
|
| 408 | 408 | ]; |
| 409 | 409 | |
| 410 | 410 | return isset($maps[$this->driver]) |
@@ -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 | } |
@@ -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; |