@@ -51,10 +51,8 @@ public function __construct(Connection $connection)
51
51
*
52
52
* @param mixed $x Optional clause. Defaults = null, but requires
53
53
* at least one defined when converting to string.
54
- *
55
- * @return CompositeExpression
56
54
*/
57
- public function andX ($ x = null )
55
+ public function andX ($ x = null ) : CompositeExpression
58
56
{
59
57
return new CompositeExpression (CompositeExpression::TYPE_AND , func_get_args ());
60
58
}
@@ -70,10 +68,8 @@ public function andX($x = null)
70
68
*
71
69
* @param mixed $x Optional clause. Defaults = null, but requires
72
70
* at least one defined when converting to string.
73
- *
74
- * @return CompositeExpression
75
71
*/
76
- public function orX ($ x = null )
72
+ public function orX ($ x = null ) : CompositeExpression
77
73
{
78
74
return new CompositeExpression (CompositeExpression::TYPE_OR , func_get_args ());
79
75
}
@@ -84,10 +80,8 @@ public function orX($x = null)
84
80
* @param mixed $x The left expression.
85
81
* @param string $operator One of the ExpressionBuilder::* constants.
86
82
* @param mixed $y The right expression.
87
- *
88
- * @return string
89
83
*/
90
- public function comparison ($ x , $ operator , $ y )
84
+ public function comparison ($ x , string $ operator , $ y ) : string
91
85
{
92
86
return $ x . ' ' . $ operator . ' ' . $ y ;
93
87
}
@@ -104,10 +98,8 @@ public function comparison($x, $operator, $y)
104
98
*
105
99
* @param mixed $x The left expression.
106
100
* @param mixed $y The right expression.
107
- *
108
- * @return string
109
101
*/
110
- public function eq ($ x , $ y )
102
+ public function eq ($ x , $ y ) : string
111
103
{
112
104
return $ this ->comparison ($ x , self ::EQ , $ y );
113
105
}
@@ -123,10 +115,8 @@ public function eq($x, $y)
123
115
*
124
116
* @param mixed $x The left expression.
125
117
* @param mixed $y The right expression.
126
- *
127
- * @return string
128
118
*/
129
- public function neq ($ x , $ y )
119
+ public function neq ($ x , $ y ) : string
130
120
{
131
121
return $ this ->comparison ($ x , self ::NEQ , $ y );
132
122
}
@@ -142,10 +132,8 @@ public function neq($x, $y)
142
132
*
143
133
* @param mixed $x The left expression.
144
134
* @param mixed $y The right expression.
145
- *
146
- * @return string
147
135
*/
148
- public function lt ($ x , $ y )
136
+ public function lt ($ x , $ y ) : string
149
137
{
150
138
return $ this ->comparison ($ x , self ::LT , $ y );
151
139
}
@@ -161,10 +149,8 @@ public function lt($x, $y)
161
149
*
162
150
* @param mixed $x The left expression.
163
151
* @param mixed $y The right expression.
164
- *
165
- * @return string
166
152
*/
167
- public function lte ($ x , $ y )
153
+ public function lte ($ x , $ y ) : string
168
154
{
169
155
return $ this ->comparison ($ x , self ::LTE , $ y );
170
156
}
@@ -180,10 +166,8 @@ public function lte($x, $y)
180
166
*
181
167
* @param mixed $x The left expression.
182
168
* @param mixed $y The right expression.
183
- *
184
- * @return string
185
169
*/
186
- public function gt ($ x , $ y )
170
+ public function gt ($ x , $ y ) : string
187
171
{
188
172
return $ this ->comparison ($ x , self ::GT , $ y );
189
173
}
@@ -199,10 +183,8 @@ public function gt($x, $y)
199
183
*
200
184
* @param mixed $x The left expression.
201
185
* @param mixed $y The right expression.
202
- *
203
- * @return string
204
186
*/
205
- public function gte ($ x , $ y )
187
+ public function gte ($ x , $ y ) : string
206
188
{
207
189
return $ this ->comparison ($ x , self ::GTE , $ y );
208
190
}
@@ -211,10 +193,8 @@ public function gte($x, $y)
211
193
* Creates an IS NULL expression with the given arguments.
212
194
*
213
195
* @param string $x The field in string format to be restricted by IS NULL.
214
- *
215
- * @return string
216
196
*/
217
- public function isNull ($ x )
197
+ public function isNull (string $ x ) : string
218
198
{
219
199
return $ x . ' IS NULL ' ;
220
200
}
@@ -223,10 +203,8 @@ public function isNull($x)
223
203
* Creates an IS NOT NULL expression with the given arguments.
224
204
*
225
205
* @param string $x The field in string format to be restricted by IS NOT NULL.
226
- *
227
- * @return string
228
206
*/
229
- public function isNotNull ($ x )
207
+ public function isNotNull (string $ x ) : string
230
208
{
231
209
return $ x . ' IS NOT NULL ' ;
232
210
}
@@ -236,10 +214,8 @@ public function isNotNull($x)
236
214
*
237
215
* @param string $x Field in string format to be inspected by LIKE() comparison.
238
216
* @param mixed $y Argument to be used in LIKE() comparison.
239
- *
240
- * @return string
241
217
*/
242
- public function like ($ x , $ y/*, ?string $escapeChar = null */ )
218
+ public function like (string $ x , $ y/*, ?string $escapeChar = null */ ) : string
243
219
{
244
220
return $ this ->comparison ($ x , 'LIKE ' , $ y ) .
245
221
(func_num_args () >= 3 ? sprintf (' ESCAPE %s ' , func_get_arg (2 )) : '' );
@@ -250,10 +226,8 @@ public function like($x, $y/*, ?string $escapeChar = null */)
250
226
*
251
227
* @param string $x Field in string format to be inspected by NOT LIKE() comparison.
252
228
* @param mixed $y Argument to be used in NOT LIKE() comparison.
253
- *
254
- * @return string
255
229
*/
256
- public function notLike ($ x , $ y/*, ?string $escapeChar = null */ )
230
+ public function notLike (string $ x , $ y/*, ?string $escapeChar = null */ ) : string
257
231
{
258
232
return $ this ->comparison ($ x , 'NOT LIKE ' , $ y ) .
259
233
(func_num_args () >= 3 ? sprintf (' ESCAPE %s ' , func_get_arg (2 )) : '' );
@@ -264,10 +238,8 @@ public function notLike($x, $y/*, ?string $escapeChar = null */)
264
238
*
265
239
* @param string $x The field in string format to be inspected by IN() comparison.
266
240
* @param string|string[] $y The placeholder or the array of values to be used by IN() comparison.
267
- *
268
- * @return string
269
241
*/
270
- public function in ($ x , $ y )
242
+ public function in (string $ x , $ y ) : string
271
243
{
272
244
return $ this ->comparison ($ x , 'IN ' , '( ' . implode (', ' , (array ) $ y ) . ') ' );
273
245
}
@@ -277,18 +249,16 @@ public function in($x, $y)
277
249
*
278
250
* @param string $x The field in string format to be inspected by NOT IN() comparison.
279
251
* @param string|string[] $y The placeholder or the array of values to be used by NOT IN() comparison.
280
- *
281
- * @return string
282
252
*/
283
- public function notIn ($ x , $ y )
253
+ public function notIn (string $ x , $ y ) : string
284
254
{
285
255
return $ this ->comparison ($ x , 'NOT IN ' , '( ' . implode (', ' , (array ) $ y ) . ') ' );
286
256
}
287
257
288
258
/**
289
259
* Creates an SQL literal expression from the string.
290
260
*/
291
- public function literal (string $ input )
261
+ public function literal (string $ input ) : string
292
262
{
293
263
return $ this ->connection ->quote ($ input );
294
264
}
0 commit comments