@@ -369,7 +369,7 @@ public function string(): bool
369369 */
370370 public function lossyPassword ($ length = 1 ): bool
371371 {
372- return (preg_match ('/^[a-zA-Z\d$@$!%*?&]{ ' . $ length . ',}$/ ' , $ this ->value ) !== false );
372+ return (( int ) preg_match ('/^[a-zA-Z\d$@$!%*?&]{ ' . $ length . ',}$/ ' , $ this ->value ) > 0 );
373373 }
374374
375375 /**
@@ -387,7 +387,7 @@ public function lossyPassword($length = 1): bool
387387 public function strictPassword ($ length = 1 ): bool
388388 {
389389 $ pattern = '/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{ ' . $ length . ',}$/ ' ;
390- return (preg_match ($ pattern , $ this ->value ) !== false );
390+ return (( int ) preg_match ($ pattern , $ this ->value ) > 0 );
391391 }
392392
393393 /**
@@ -396,7 +396,7 @@ public function strictPassword($length = 1): bool
396396 */
397397 public function pregMatch ($ matchStr ): bool
398398 {
399- return (preg_match ("/^[ " . $ matchStr . "]+$/ " , $ this ->value ) !== false );
399+ return (( int ) preg_match ("/^[ " . $ matchStr . "]+$/ " , $ this ->value ) > 0 );
400400 }
401401
402402
@@ -406,7 +406,7 @@ public function pregMatch($matchStr): bool
406406 */
407407 public function atoZ (): bool
408408 {
409- return (preg_match ("/^[a-zA-Z]+$/ " , $ this ->value ) !== false );
409+ return (( int ) preg_match ("/^[a-zA-Z]+$/ " , $ this ->value ) > 0 );
410410 }
411411
412412 /**
@@ -415,7 +415,7 @@ public function atoZ(): bool
415415 */
416416 public function lowerAtoZ (): bool
417417 {
418- return (preg_match ("/^[a-z]+$/ " , $ this ->value ) !== false );
418+ return (( int ) preg_match ("/^[a-z]+$/ " , $ this ->value ) > 0 );
419419 }
420420
421421 /**
@@ -424,7 +424,7 @@ public function lowerAtoZ(): bool
424424 */
425425 public function upperAtoZ (): bool
426426 {
427- return (preg_match ("/^[A-Z]+$/ " , $ this ->value ) !== false );
427+ return (( int ) preg_match ("/^[A-Z]+$/ " , $ this ->value ) > 0 );
428428 }
429429
430430
@@ -434,7 +434,7 @@ public function upperAtoZ(): bool
434434 */
435435 public function hex (): bool
436436 {
437- return (preg_match ('/^#([0-9A-F]{3}){1,2}$/i ' , $ this ->value ) !== false );
437+ return (( int ) preg_match ('/^#([0-9A-F]{3}){1,2}$/i ' , $ this ->value ) > 0 );
438438 }
439439
440440 /**
0 commit comments