@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @return $this |
76 | 76 | */ |
77 | 77 | public function on( |
78 | - string|Expression|Closure $column1, |
|
79 | - string|Expression|Closure|bool|null $column2 = null, |
|
78 | + string | Expression | Closure $column1, |
|
79 | + string | Expression | Closure | bool | null $column2 = null, |
|
80 | 80 | string $operator = '=' |
81 | 81 | ): self { |
82 | 82 | return $this->addJoinCondition($column1, $column2, $operator, 'AND'); |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | * @return $this |
90 | 90 | */ |
91 | 91 | public function andOn( |
92 | - string|Expression|Closure $column1, |
|
93 | - string|Expression|Closure|bool|null $column2 = null, |
|
92 | + string | Expression | Closure $column1, |
|
93 | + string | Expression | Closure | bool | null $column2 = null, |
|
94 | 94 | string $operator = '=' |
95 | 95 | ): self { |
96 | 96 | return $this->addJoinCondition($column1, $column2, $operator, 'AND'); |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | * @return $this |
104 | 104 | */ |
105 | 105 | public function orOn( |
106 | - string|Expression|Closure $column1, |
|
107 | - string|Expression|Closure|bool|null $column2 = null, |
|
106 | + string | Expression | Closure $column1, |
|
107 | + string | Expression | Closure | bool | null $column2 = null, |
|
108 | 108 | string $operator = '=' |
109 | 109 | ): self { |
110 | 110 | return $this->addJoinCondition($column1, $column2, $operator, 'OR'); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param string $separator |
116 | 116 | * @return $this |
117 | 117 | */ |
118 | - protected function addJoinExpression(Expression|Closure $expression, string $separator = 'AND'): self |
|
118 | + protected function addJoinExpression(Expression | Closure $expression, string $separator = 'AND'): self |
|
119 | 119 | { |
120 | 120 | if ($expression instanceof Closure) { |
121 | 121 | $expression = Expression::fromClosure($expression); |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | * @return $this |
139 | 139 | */ |
140 | 140 | protected function addJoinCondition( |
141 | - string|Expression|Closure $column1, |
|
142 | - string|Expression|Closure|bool|null $column2, |
|
141 | + string | Expression | Closure $column1, |
|
142 | + string | Expression | Closure | bool | null $column2, |
|
143 | 143 | string $operator, |
144 | 144 | string $separator = 'AND' |
145 | 145 | ): self { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | /** |
73 | 73 | * @var string|Expression |
74 | 74 | */ |
75 | - protected string|Expression $column; |
|
75 | + protected string | Expression $column; |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * @var string |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param string $separator |
96 | 96 | * @return self |
97 | 97 | */ |
98 | - public function init(string|Expression|Closure $column, string $separator): self |
|
98 | + public function init(string | Expression | Closure $column, string $separator): self |
|
99 | 99 | { |
100 | 100 | if ($column instanceof Closure) { |
101 | 101 | $column = Expression::fromClosure($column); |
@@ -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); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @param QueryStatement|null $queryStatement |
59 | 59 | */ |
60 | 60 | public function __construct( |
61 | - string|array $from, |
|
61 | + string | array $from, |
|
62 | 62 | ?QueryStatement $queryStatement = null |
63 | 63 | ) { |
64 | 64 | parent::__construct($queryStatement); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @param string|array<string> $tables |
75 | 75 | * @return mixed |
76 | 76 | */ |
77 | - public function delete(string|array $tables = []) |
|
77 | + public function delete(string | array $tables = []) |
|
78 | 78 | { |
79 | 79 | if (!is_array($tables)) { |
80 | 80 | $tables = [$tables]; |
@@ -50,8 +50,7 @@ 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 | * DeleteStatement constructor. |
57 | 56 | * @param string|array<string> $from |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | * @param string|array<string> $tables |
75 | 74 | * @return mixed |
76 | 75 | */ |
77 | - public function delete(string|array $tables = []) |
|
78 | - { |
|
76 | + public function delete(string|array $tables = []) { |
|
79 | 77 | if (!is_array($tables)) { |
80 | 78 | $tables = [$tables]; |
81 | 79 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | * @param string|array<int, string> $tables |
63 | 63 | * @return SelectStatement |
64 | 64 | */ |
65 | - public function from(string|array $tables): SelectStatement |
|
65 | + public function from(string | array $tables): SelectStatement |
|
66 | 66 | { |
67 | 67 | return $this->select = new SelectStatement($tables); |
68 | 68 | } |
@@ -50,8 +50,7 @@ |
||
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 |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | * @return WhereStatement|Where|Select|Delete|Update |
95 | 95 | */ |
96 | 96 | public function where( |
97 | - string|Expression|Closure $column, |
|
97 | + string | Expression | Closure $column, |
|
98 | 98 | bool $isExpression = false |
99 | - ): WhereStatement|Where|Select|Delete|Update { |
|
99 | + ): WhereStatement | Where | Select | Delete | Update { |
|
100 | 100 | return $this->addWhereCondition($column, 'AND', $isExpression); |
101 | 101 | } |
102 | 102 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @return WhereStatement|Where|Select|Delete|Update |
108 | 108 | */ |
109 | - public function orWhere(string|Expression|Closure $column, bool $isExpression = false): WhereStatement|Where|Select|Delete|Update |
|
109 | + public function orWhere(string | Expression | Closure $column, bool $isExpression = false): WhereStatement | Where | Select | Delete | Update |
|
110 | 110 | { |
111 | 111 | return $this->addWhereCondition($column, 'OR', $isExpression); |
112 | 112 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param Closure $select |
116 | 116 | * @return WhereStatement|Select|Delete|Update |
117 | 117 | */ |
118 | - public function whereExists(Closure $select): WhereStatement|Select|Delete|Update |
|
118 | + public function whereExists(Closure $select): WhereStatement | Select | Delete | Update |
|
119 | 119 | { |
120 | 120 | return $this->addWhereExistsCondition($select, 'AND', false); |
121 | 121 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @param Closure $select |
125 | 125 | * @return WhereStatement|Select|Delete|Update |
126 | 126 | */ |
127 | - public function orWhereExists(Closure $select): WhereStatement|Select|Delete|Update |
|
127 | + public function orWhereExists(Closure $select): WhereStatement | Select | Delete | Update |
|
128 | 128 | { |
129 | 129 | return $this->addWhereExistsCondition($select, 'OR', false); |
130 | 130 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @param Closure $select |
134 | 134 | * @return WhereStatement|Select|Delete|Update |
135 | 135 | */ |
136 | - public function whereNotExists(Closure $select): WhereStatement|Select|Delete|Update |
|
136 | + public function whereNotExists(Closure $select): WhereStatement | Select | Delete | Update |
|
137 | 137 | { |
138 | 138 | return $this->addWhereExistsCondition($select, 'AND', true); |
139 | 139 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @param Closure $select |
143 | 143 | * @return WhereStatement|Select|Delete|Update |
144 | 144 | */ |
145 | - public function orWhereNotExists(Closure $select): WhereStatement|Select|Delete|Update |
|
145 | + public function orWhereNotExists(Closure $select): WhereStatement | Select | Delete | Update |
|
146 | 146 | { |
147 | 147 | return $this->addWhereExistsCondition($select, 'OR', true); |
148 | 148 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | mixed $column, |
168 | 168 | string $separator = 'AND', |
169 | 169 | bool $isExpression = false |
170 | - ): WhereStatement|Where { |
|
170 | + ): WhereStatement | Where { |
|
171 | 171 | if (($column instanceof Closure) && !$isExpression) { |
172 | 172 | $this->queryStatement->addWhereGroup($column, $separator); |
173 | 173 |
@@ -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 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * @var string|Expression |
59 | 59 | */ |
60 | - protected string|Expression $aggregate; |
|
60 | + protected string | Expression $aggregate; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * @var string |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @param string $separator |
85 | 85 | * @return self |
86 | 86 | */ |
87 | - public function init(string|Expression|Closure $aggregate, string $separator): self |
|
87 | + public function init(string | Expression | Closure $aggregate, string $separator): self |
|
88 | 88 | { |
89 | 89 | if ($aggregate instanceof Closure) { |
90 | 90 | $aggregate = Expression::fromClosure($aggregate); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @param array<int, mixed>|Closure $value |
212 | 212 | * @return void |
213 | 213 | */ |
214 | - public function in(array|Closure $value): void |
|
214 | + public function in(array | Closure $value): void |
|
215 | 215 | { |
216 | 216 | $this->queryStatement->addHavingIn( |
217 | 217 | $this->aggregate, |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * @param array<int, mixed>|Closure $value |
226 | 226 | * @return void |
227 | 227 | */ |
228 | - public function notIn(array|Closure $value): void |
|
228 | + public function notIn(array | Closure $value): void |
|
229 | 229 | { |
230 | 230 | $this->queryStatement->addHavingIn( |
231 | 231 | $this->aggregate, |
@@ -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 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return Delete|Select|BaseStatement |
62 | 62 | */ |
63 | - public function join(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
63 | + public function join(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
64 | 64 | { |
65 | 65 | $this->queryStatement->addJoinClause('INNER', $table, $closure); |
66 | 66 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @return Delete|Select|BaseStatement |
75 | 75 | */ |
76 | - public function leftJoin(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
76 | + public function leftJoin(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
77 | 77 | { |
78 | 78 | $this->queryStatement->addJoinClause('LEFT', $table, $closure); |
79 | 79 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return Delete|Select|BaseStatement |
88 | 88 | */ |
89 | - public function rightJoin(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
89 | + public function rightJoin(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
90 | 90 | { |
91 | 91 | $this->queryStatement->addJoinClause('RIGHT', $table, $closure); |
92 | 92 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * |
100 | 100 | * @return Delete|Select|BaseStatement |
101 | 101 | */ |
102 | - public function fullJoin(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
102 | + public function fullJoin(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
103 | 103 | { |
104 | 104 | $this->queryStatement->addJoinClause('FULL', $table, $closure); |
105 | 105 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * |
113 | 113 | * @return Delete|Select|BaseStatement |
114 | 114 | */ |
115 | - public function crossJoin(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
115 | + public function crossJoin(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
116 | 116 | { |
117 | 117 | $this->queryStatement->addJoinClause('CROSS', $table, $closure); |
118 | 118 |
@@ -52,8 +52,7 @@ |
||
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 |
@@ -63,7 +63,7 @@ |
||
63 | 63 | * @param string|array<int, string> $table |
64 | 64 | * @param QueryStatement|null $queryStatement |
65 | 65 | */ |
66 | - public function __construct(string|array $table, ?QueryStatement $queryStatement = null) |
|
66 | + public function __construct(string | array $table, ?QueryStatement $queryStatement = null) |
|
67 | 67 | { |
68 | 68 | parent::__construct($queryStatement); |
69 | 69 |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | * @class UpdateStatement |
51 | 51 | * @package Platine\Database\Query |
52 | 52 | */ |
53 | -class UpdateStatement extends BaseStatement |
|
54 | -{ |
|
53 | +class UpdateStatement extends BaseStatement { |
|
55 | 54 | /** |
56 | 55 | * The Query statement instance |
57 | 56 | * @var QueryStatement |
@@ -63,8 +62,7 @@ discard block |
||
63 | 62 | * @param string|array<int, string> $table |
64 | 63 | * @param QueryStatement|null $queryStatement |
65 | 64 | */ |
66 | - public function __construct(string|array $table, ?QueryStatement $queryStatement = null) |
|
67 | - { |
|
65 | + public function __construct(string|array $table, ?QueryStatement $queryStatement = null) { |
|
68 | 66 | parent::__construct($queryStatement); |
69 | 67 | |
70 | 68 | if (!is_array($table)) { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @param Closure|null $value |
93 | 93 | * @return self |
94 | 94 | */ |
95 | - public function having(string|Expression|Closure $column, ?Closure $value = null): self |
|
95 | + public function having(string | Expression | Closure $column, ?Closure $value = null): self |
|
96 | 96 | { |
97 | 97 | return $this->addCondition($column, $value, 'AND'); |
98 | 98 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @param Closure|null $value |
103 | 103 | * @return self |
104 | 104 | */ |
105 | - public function orHaving(string|Expression|Closure $column, ?Closure $value = null): self |
|
105 | + public function orHaving(string | Expression | Closure $column, ?Closure $value = null): self |
|
106 | 106 | { |
107 | 107 | return $this->addCondition($column, $value, 'OR'); |
108 | 108 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * @return self |
124 | 124 | */ |
125 | 125 | protected function addCondition( |
126 | - string|Expression|Closure $column, |
|
126 | + string | Expression | Closure $column, |
|
127 | 127 | ?Closure $value = null, |
128 | 128 | string $separator = 'AND' |
129 | 129 | ): self { |
@@ -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 | } |