Skip to content

Commit

Permalink
Merge pull request #710 from DannyvdSluijs/pr-641-alternative
Browse files Browse the repository at this point in the history
refactor: Remove dead block of code
  • Loading branch information
Seldaek authored May 21, 2024
2 parents 42011a6 + 67cff3b commit 9e3c631
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/JsonSchema/Constraints/FormatConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,6 @@ protected function validateDateTime($datetime, $format)
return true;
}

// handles the case where a non-6 digit microsecond datetime is passed
// which will fail the above string comparison because the passed
// $datetime may be '2000-05-01T12:12:12.123Z' but format() will return
// '2000-05-01T12:12:12.123000Z'
if ((strpos('u', $format) !== -1) && (preg_match('/\.\d+Z$/', $datetime))) {
return true;
}

return false;
}

Expand Down

0 comments on commit 9e3c631

Please sign in to comment.