Skip to content

Commit

Permalink
Merge pull request #1 from mattrenner/master
Browse files Browse the repository at this point in the history
Fix deprecated usage of preg_match
  • Loading branch information
phindmarsh authored Mar 9, 2023
2 parents 568920d + 3872c3d commit 317c1cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Schema/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function isGreaterThanOrEqualToZero(Report $report, $schema, $key){
}

public function isValidRegex(Report $report, $schema, $key){
if(preg_match(Utils::regex($schema->$key), null) === false){
if(preg_match(Utils::regex($schema->$key), "") === false){
$report->addError('KEYWORD_PATTERN', [$key, Utils::regex($schema->$key)]);
}
}
Expand Down Expand Up @@ -154,7 +154,7 @@ public function isPatternProperties(Report $report, $schema, $key){
$report->pathPush($key);
foreach($schema->$key as $i => $value){

if(preg_match(Utils::regex($i), null) === false){
if(preg_match(Utils::regex($i), "") === false){
$report->addError('KEYWORD_PATTERN', [$key, Utils::regex($i)]);
}

Expand Down

0 comments on commit 317c1cf

Please sign in to comment.