@@ -369,7 +369,7 @@ public function string(): bool
369
369
*/
370
370
public function lossyPassword ($ length = 1 ): bool
371
371
{
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 );
373
373
}
374
374
375
375
/**
@@ -387,7 +387,7 @@ public function lossyPassword($length = 1): bool
387
387
public function strictPassword ($ length = 1 ): bool
388
388
{
389
389
$ 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 );
391
391
}
392
392
393
393
/**
@@ -396,7 +396,7 @@ public function strictPassword($length = 1): bool
396
396
*/
397
397
public function pregMatch ($ matchStr ): bool
398
398
{
399
- return (preg_match ("/^[ " . $ matchStr . "]+$/ " , $ this ->value ) !== false );
399
+ return (( int ) preg_match ("/^[ " . $ matchStr . "]+$/ " , $ this ->value ) > 0 );
400
400
}
401
401
402
402
@@ -406,7 +406,7 @@ public function pregMatch($matchStr): bool
406
406
*/
407
407
public function atoZ (): bool
408
408
{
409
- return (preg_match ("/^[a-zA-Z]+$/ " , $ this ->value ) !== false );
409
+ return (( int ) preg_match ("/^[a-zA-Z]+$/ " , $ this ->value ) > 0 );
410
410
}
411
411
412
412
/**
@@ -415,7 +415,7 @@ public function atoZ(): bool
415
415
*/
416
416
public function lowerAtoZ (): bool
417
417
{
418
- return (preg_match ("/^[a-z]+$/ " , $ this ->value ) !== false );
418
+ return (( int ) preg_match ("/^[a-z]+$/ " , $ this ->value ) > 0 );
419
419
}
420
420
421
421
/**
@@ -424,7 +424,7 @@ public function lowerAtoZ(): bool
424
424
*/
425
425
public function upperAtoZ (): bool
426
426
{
427
- return (preg_match ("/^[A-Z]+$/ " , $ this ->value ) !== false );
427
+ return (( int ) preg_match ("/^[A-Z]+$/ " , $ this ->value ) > 0 );
428
428
}
429
429
430
430
@@ -434,7 +434,7 @@ public function upperAtoZ(): bool
434
434
*/
435
435
public function hex (): bool
436
436
{
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 );
438
438
}
439
439
440
440
/**
0 commit comments