44
55namespace ezsql \functions ;
66
7+ use ezsql \Db ;
78use ezsql \ezQuery ;
89use ezsql \ezSchema ;
910use ezsql \Database ;
1011use ezsql \ezQueryInterface ;
1112use ezsql \DatabaseInterface ;
12- use ezsql \Db ;
1313use ezsql \ezsqlModelInterface ;
1414
1515if (!\function_exists ('ezFunctions ' )) {
@@ -244,7 +244,7 @@ function changingColumn(string $columnName, ...$datatype)
244244 *
245245 * @return array
246246 */
247- function eq ($ x , $ y , $ and = null , ...$ args )
247+ function eq ($ x , $ y , $ and = null , ...$ args ): array
248248 {
249249 $ expression = array ();
250250 \array_push ($ expression , $ x , \EQ , $ y , $ and , ...$ args );
@@ -270,7 +270,7 @@ function eq($x, $y, $and = null, ...$args)
270270 *
271271 * @return array
272272 */
273- function neq ($ x , $ y , $ and = null , ...$ args )
273+ function neq ($ x , $ y , $ and = null , ...$ args ): array
274274 {
275275 $ expression = array ();
276276 \array_push ($ expression , $ x , \NEQ , $ y , $ and , ...$ args );
@@ -287,7 +287,7 @@ function neq($x, $y, $and = null, ...$args)
287287 *
288288 * @return array
289289 */
290- function ne ($ x , $ y , $ and = null , ...$ args )
290+ function ne ($ x , $ y , $ and = null , ...$ args ): array
291291 {
292292 $ expression = array ();
293293 \array_push ($ expression , $ x , \NE , $ y , $ and , ...$ args );
@@ -304,7 +304,7 @@ function ne($x, $y, $and = null, ...$args)
304304 *
305305 * @return array
306306 */
307- function lt ($ x , $ y , $ and = null , ...$ args )
307+ function lt ($ x , $ y , $ and = null , ...$ args ): array
308308 {
309309 $ expression = array ();
310310 \array_push ($ expression , $ x , \LT , $ y , $ and , ...$ args );
@@ -321,7 +321,7 @@ function lt($x, $y, $and = null, ...$args)
321321 *
322322 * @return array
323323 */
324- function lte ($ x , $ y , $ and = null , ...$ args )
324+ function lte ($ x , $ y , $ and = null , ...$ args ): array
325325 {
326326 $ expression = array ();
327327 \array_push ($ expression , $ x , \LTE , $ y , $ and , ...$ args );
@@ -338,7 +338,7 @@ function lte($x, $y, $and = null, ...$args)
338338 *
339339 * @return array
340340 */
341- function gt ($ x , $ y , $ and = null , ...$ args )
341+ function gt ($ x , $ y , $ and = null , ...$ args ): array
342342 {
343343 $ expression = array ();
344344 \array_push ($ expression , $ x , \GT , $ y , $ and , ...$ args );
@@ -355,7 +355,7 @@ function gt($x, $y, $and = null, ...$args)
355355 *
356356 * @return array
357357 */
358- function gte ($ x , $ y , $ and = null , ...$ args )
358+ function gte ($ x , $ y , $ and = null , ...$ args ): array
359359 {
360360 $ expression = array ();
361361 \array_push ($ expression , $ x , \GTE , $ y , $ and , ...$ args );
@@ -372,7 +372,7 @@ function gte($x, $y, $and = null, ...$args)
372372 *
373373 * @return array
374374 */
375- function isNull ($ x , $ y = 'null ' , $ and = null , ...$ args )
375+ function isNull ($ x , $ y = 'null ' , $ and = null , ...$ args ): array
376376 {
377377 $ expression = array ();
378378 \array_push ($ expression , $ x , \_isNULL, $ y , $ and , ...$ args );
@@ -389,7 +389,7 @@ function isNull($x, $y = 'null', $and = null, ...$args)
389389 *
390390 * @return array
391391 */
392- function isNotNull ($ x , $ y = 'null ' , $ and = null , ...$ args )
392+ function isNotNull ($ x , $ y = 'null ' , $ and = null , ...$ args ): array
393393 {
394394 $ expression = array ();
395395 \array_push ($ expression , $ x , \_notNULL, $ y , $ and , ...$ args );
@@ -406,7 +406,7 @@ function isNotNull($x, $y = 'null', $and = null, ...$args)
406406 *
407407 * @return array
408408 */
409- function like ($ x , $ y , $ and = null , ...$ args )
409+ function like ($ x , $ y , $ and = null , ...$ args ): array
410410 {
411411 $ expression = array ();
412412 \array_push ($ expression , $ x , \_LIKE , $ y , $ and , ...$ args );
@@ -423,7 +423,7 @@ function like($x, $y, $and = null, ...$args)
423423 *
424424 * @return array
425425 */
426- function notLike ($ x , $ y , $ and = null , ...$ args )
426+ function notLike ($ x , $ y , $ and = null , ...$ args ): array
427427 {
428428 $ expression = array ();
429429 \array_push ($ expression , $ x , \_notLIKE, $ y , $ and , ...$ args );
@@ -440,7 +440,7 @@ function notLike($x, $y, $and = null, ...$args)
440440 *
441441 * @return array
442442 */
443- function in ($ x , $ y , ...$ args )
443+ function in ($ x , $ y , ...$ args ): array
444444 {
445445 $ expression = array ();
446446 \array_push ($ expression , $ x , \_IN , $ y , ...$ args );
@@ -457,7 +457,7 @@ function in($x, $y, ...$args)
457457 *
458458 * @return array
459459 */
460- function notIn ($ x , $ y , ...$ args )
460+ function notIn ($ x , $ y , ...$ args ): array
461461 {
462462 $ expression = array ();
463463 \array_push ($ expression , $ x , \_notIN, $ y , ...$ args );
@@ -474,7 +474,7 @@ function notIn($x, $y, ...$args)
474474 *
475475 * @return array
476476 */
477- function between ($ x , $ y , $ y2 , ...$ args )
477+ function between ($ x , $ y , $ y2 , ...$ args ): array
478478 {
479479 $ expression = array ();
480480 \array_push ($ expression , $ x , \_BETWEEN , $ y , $ y2 , \_AND , ...$ args );
@@ -491,7 +491,7 @@ function between($x, $y, $y2, ...$args)
491491 *
492492 * @return array
493493 */
494- function notBetween ($ x , $ y , $ y2 , ...$ args )
494+ function notBetween ($ x , $ y , $ y2 , ...$ args ): array
495495 {
496496 $ expression = array ();
497497 \array_push ($ expression , $ x , \_notBETWEEN, $ y , $ y2 , \_AND , ...$ args );
@@ -540,7 +540,7 @@ function get_results($output = \OBJECT, $instance = null)
540540 *
541541 * @return string cleaned string
542542 */
543- function clean_string (string $ string )
543+ function clean_string (string $ string ): string
544544 {
545545 $ patterns = array ( // strip out:
546546 '@<script[^>]*?>.*?</script>@si ' , // Strip out javascript
@@ -563,7 +563,7 @@ function clean_string(string $string)
563563 * @param string $filename will be preprocess with `sanitize_path()`
564564 * @return boolean
565565 */
566- function is_traversal (string $ basePath , string $ filename )
566+ function is_traversal (string $ basePath , string $ filename ): bool
567567 {
568568 if (\strpos (\urldecode ($ filename ), '.. ' ) !== false )
569569 return true ;
@@ -588,7 +588,7 @@ function is_traversal(string $basePath, string $filename)
588588 * @param string $path original file/path to be sanitized.
589589 * @return string
590590 */
591- function sanitize_path (string $ path )
591+ function sanitize_path (string $ path ): string
592592 {
593593 $ file = \preg_replace ("/\.[\.]+/ " , "" , $ path );
594594 $ file = \preg_replace ("/^[\/]+/ " , "" , $ file );
0 commit comments