Commit b479cbdd authored by Benjamin Eberlei's avatar Benjamin Eberlei

DBAL-26 - Add strict null check

parent bb2ffc4f
......@@ -46,8 +46,8 @@ class DateTimeType extends Type
public function convertToPHPValue($value, AbstractPlatform $platform)
{
if (!$value) {
return $value;
if ($value === null) {
return null;
}
$val = \DateTime::createFromFormat($platform->getDateTimeFormatString(), $value);
......
......@@ -66,8 +66,8 @@ class DateTimeTzType extends Type
public function convertToPHPValue($value, AbstractPlatform $platform)
{
if (!$value) {
return $value;
if ($value === null) {
return null;
}
$val = \DateTime::createFromFormat($platform->getDateTimeTzFormatString(), $value);
......
......@@ -46,8 +46,8 @@ class DateType extends Type
public function convertToPHPValue($value, AbstractPlatform $platform)
{
if (!$value) {
return $value;
if ($value === null) {
return null;
}
$val = \DateTime::createFromFormat('!'.$platform->getDateFormatString(), $value);
......
......@@ -55,8 +55,8 @@ class TimeType extends Type
*/
public function convertToPHPValue($value, AbstractPlatform $platform)
{
if (!$value) {
return $value;
if ($value === null) {
return null;
}
$val = \DateTime::createFromFormat($platform->getTimeFormatString(), $value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment