@@ -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 |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | * Class HavingStatement |
53 | 53 | * @package Platine\Database\Query |
54 | 54 | */ |
55 | -class HavingStatement |
|
56 | -{ |
|
55 | +class HavingStatement { |
|
57 | 56 | /** |
58 | 57 | * The Query statement instance |
59 | 58 | * @var QueryStatement |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | * HavingStatement constructor. |
71 | 70 | * @param QueryStatement|null $queryStatement |
72 | 71 | */ |
73 | - public function __construct(QueryStatement $queryStatement = null) |
|
74 | - { |
|
72 | + public function __construct(QueryStatement $queryStatement = null) { |
|
75 | 73 | if ($queryStatement === null) { |
76 | 74 | $queryStatement = new QueryStatement(); |
77 | 75 | } |
@@ -110,8 +108,7 @@ discard block |
||
110 | 108 | /** |
111 | 109 | * @inheritDoc |
112 | 110 | */ |
113 | - public function __clone() |
|
114 | - { |
|
111 | + public function __clone() { |
|
115 | 112 | $this->queryStatement = clone $this->queryStatement; |
116 | 113 | $this->expression = new HavingExpression($this->queryStatement); |
117 | 114 | } |
@@ -52,8 +52,7 @@ |
||
52 | 52 | * Class Join |
53 | 53 | * @package Platine\Database\Query |
54 | 54 | */ |
55 | -class Join |
|
56 | -{ |
|
55 | +class Join { |
|
57 | 56 | /** |
58 | 57 | * The Join conditions |
59 | 58 | * @var array<int, mixed> |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | * Class WhereStatement |
53 | 53 | * @package Platine\Database\Query |
54 | 54 | */ |
55 | -class WhereStatement |
|
56 | -{ |
|
55 | +class WhereStatement { |
|
57 | 56 | /** |
58 | 57 | * The Query statement instance |
59 | 58 | * @var QueryStatement |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | * WhereStatement constructor. |
71 | 70 | * @param QueryStatement|null $queryStatement |
72 | 71 | */ |
73 | - public function __construct(QueryStatement $queryStatement = null) |
|
74 | - { |
|
72 | + public function __construct(QueryStatement $queryStatement = null) { |
|
75 | 73 | if ($queryStatement === null) { |
76 | 74 | $queryStatement = new QueryStatement(); |
77 | 75 | } |
@@ -93,8 +91,7 @@ discard block |
||
93 | 91 | * |
94 | 92 | * @return WhereStatement|Where|Select|Delete|Update |
95 | 93 | */ |
96 | - public function where($column, bool $isExpression = false) |
|
97 | - { |
|
94 | + public function where($column, bool $isExpression = false) { |
|
98 | 95 | return $this->addWhereCondition($column, 'AND', $isExpression); |
99 | 96 | } |
100 | 97 | |
@@ -104,8 +101,7 @@ discard block |
||
104 | 101 | * |
105 | 102 | * @return WhereStatement|Where|Select|Delete|Update |
106 | 103 | */ |
107 | - public function orWhere($column, bool $isExpression = false) |
|
108 | - { |
|
104 | + public function orWhere($column, bool $isExpression = false) { |
|
109 | 105 | return $this->addWhereCondition($column, 'OR', $isExpression); |
110 | 106 | } |
111 | 107 | |
@@ -148,8 +144,7 @@ discard block |
||
148 | 144 | /** |
149 | 145 | * @inheritDoc |
150 | 146 | */ |
151 | - public function __clone() |
|
152 | - { |
|
147 | + public function __clone() { |
|
153 | 148 | $this->queryStatement = clone $this->queryStatement; |
154 | 149 | $this->where = new Where($this, $this->queryStatement); |
155 | 150 | } |
@@ -161,8 +156,7 @@ discard block |
||
161 | 156 | * |
162 | 157 | * @return WhereStatement|Where |
163 | 158 | */ |
164 | - protected function addWhereCondition($column, string $separator = 'AND', bool $isExpression = false) |
|
165 | - { |
|
159 | + protected function addWhereCondition($column, string $separator = 'AND', bool $isExpression = false) { |
|
166 | 160 | if (($column instanceof Closure) && !$isExpression) { |
167 | 161 | $this->queryStatement->addWhereGroup($column, $separator); |
168 | 162 |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | * Class HavingExpression |
56 | 56 | * @package Platine\Database\Query |
57 | 57 | */ |
58 | -class HavingExpression |
|
59 | -{ |
|
58 | +class HavingExpression { |
|
60 | 59 | /** |
61 | 60 | * The Query statement instance |
62 | 61 | * @var QueryStatement |
@@ -83,8 +82,7 @@ discard block |
||
83 | 82 | * HavingExpression constructor. |
84 | 83 | * @param QueryStatement $queryStatement |
85 | 84 | */ |
86 | - public function __construct(QueryStatement $queryStatement) |
|
87 | - { |
|
85 | + public function __construct(QueryStatement $queryStatement) { |
|
88 | 86 | $this->queryStatement = $queryStatement; |
89 | 87 | |
90 | 88 | $this->having = new Having($queryStatement); |
@@ -164,8 +162,7 @@ discard block |
||
164 | 162 | /** |
165 | 163 | * @inheritDoc |
166 | 164 | */ |
167 | - public function __clone() |
|
168 | - { |
|
165 | + public function __clone() { |
|
169 | 166 | if ($this->column instanceof Expression) { |
170 | 167 | $this->column = clone $this->column; |
171 | 168 | } |
@@ -52,16 +52,14 @@ discard block |
||
52 | 52 | * Class BaseStatement |
53 | 53 | * @package Platine\Database\Query |
54 | 54 | */ |
55 | -class BaseStatement extends WhereStatement |
|
56 | -{ |
|
55 | +class BaseStatement extends WhereStatement { |
|
57 | 56 | /** |
58 | 57 | * @param string|string[] $table |
59 | 58 | * @param Closure $closure |
60 | 59 | * |
61 | 60 | * @return Delete|Select|BaseStatement |
62 | 61 | */ |
63 | - public function join($table, Closure $closure) |
|
64 | - { |
|
62 | + public function join($table, Closure $closure) { |
|
65 | 63 | $this->queryStatement->addJoinClause('INNER', $table, $closure); |
66 | 64 | |
67 | 65 | return $this; |
@@ -73,8 +71,7 @@ discard block |
||
73 | 71 | * |
74 | 72 | * @return Delete|Select|BaseStatement |
75 | 73 | */ |
76 | - public function leftJoin($table, Closure $closure) |
|
77 | - { |
|
74 | + public function leftJoin($table, Closure $closure) { |
|
78 | 75 | $this->queryStatement->addJoinClause('LEFT', $table, $closure); |
79 | 76 | |
80 | 77 | return $this; |
@@ -86,8 +83,7 @@ discard block |
||
86 | 83 | * |
87 | 84 | * @return Delete|Select|BaseStatement |
88 | 85 | */ |
89 | - public function rightJoin($table, Closure $closure) |
|
90 | - { |
|
86 | + public function rightJoin($table, Closure $closure) { |
|
91 | 87 | $this->queryStatement->addJoinClause('RIGHT', $table, $closure); |
92 | 88 | |
93 | 89 | return $this; |
@@ -99,8 +95,7 @@ discard block |
||
99 | 95 | * |
100 | 96 | * @return Delete|Select|BaseStatement |
101 | 97 | */ |
102 | - public function fullJoin($table, Closure $closure) |
|
103 | - { |
|
98 | + public function fullJoin($table, Closure $closure) { |
|
104 | 99 | $this->queryStatement->addJoinClause('FULL', $table, $closure); |
105 | 100 | |
106 | 101 | return $this; |
@@ -112,8 +107,7 @@ discard block |
||
112 | 107 | * |
113 | 108 | * @return Delete|Select|BaseStatement |
114 | 109 | */ |
115 | - public function crossJoin($table, Closure $closure) |
|
116 | - { |
|
110 | + public function crossJoin($table, Closure $closure) { |
|
117 | 111 | $this->queryStatement->addJoinClause('CROSS', $table, $closure); |
118 | 112 | |
119 | 113 | return $this; |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | * Class Having |
53 | 53 | * @package Platine\Database\Query |
54 | 54 | */ |
55 | -class Having |
|
56 | -{ |
|
55 | +class Having { |
|
57 | 56 | /** |
58 | 57 | * @var string|Expression |
59 | 58 | */ |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | * Having constructor. |
75 | 74 | * @param QueryStatement $queryStatement |
76 | 75 | */ |
77 | - public function __construct(QueryStatement $queryStatement) |
|
78 | - { |
|
76 | + public function __construct(QueryStatement $queryStatement) { |
|
79 | 77 | $this->queryStatement = $queryStatement; |
80 | 78 | } |
81 | 79 | |
@@ -238,8 +236,7 @@ discard block |
||
238 | 236 | /** |
239 | 237 | * @inheritDoc |
240 | 238 | */ |
241 | - public function __clone() |
|
242 | - { |
|
239 | + public function __clone() { |
|
243 | 240 | if ($this->aggregate instanceof Expression) { |
244 | 241 | $this->aggregate = clone $this->aggregate; |
245 | 242 | } |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | * Class SubQuery |
51 | 51 | * @package Platine\Database\Query |
52 | 52 | */ |
53 | -class SubQuery |
|
54 | -{ |
|
53 | +class SubQuery { |
|
55 | 54 | /** |
56 | 55 | * The SelectStatement instance |
57 | 56 | * @var SelectStatement |
@@ -78,8 +77,7 @@ discard block |
||
78 | 77 | /** |
79 | 78 | * @inheritDoc |
80 | 79 | */ |
81 | - public function __clone() |
|
82 | - { |
|
80 | + public function __clone() { |
|
83 | 81 | $this->select = clone $this->select; |
84 | 82 | } |
85 | 83 | } |