Skip to content

Commit

Permalink
Merge pull request #18 from onelazydev/datetime-construct-null
Browse files Browse the repository at this point in the history
PHP Deprecation warning fix
  • Loading branch information
miqwit authored Nov 1, 2022
2 parents 63dc2b0 + 0c27b6d commit c273923
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Controller/ErnParserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,13 @@ private function instanciateClass($class_name) {
if ($class_name === "\DateInterval") {
// For DateInterval can't instanciate with null
return new DateInterval("PT0M0S"); // will be erased
} else if ($class_name === "\DedexBundle\Entity\Ern382\EventDateTimeType") {
}

if ($class_name === '\DateTime') {
return new $class_name('');
}

if ($class_name === "\DedexBundle\Entity\Ern382\EventDateTimeType") {
return new \DedexBundle\Entity\Ern382\EventDateTimeType(new \DateTime()); // TODO
}

Expand Down

0 comments on commit c273923

Please sign in to comment.