protected function setDate($data, $key, DateTIme $currentDate, callable $setCallback)
    {
        $date = $this->getProperty($data, $key, $currentDate);
        if ($date !== null) {
            if (is_string($date)) {
                $date = new DateTime($data[$key]);
            }
            call_user_func($setCallback, $date);
        }
    }
protected function setDate($data, $key, DateTIme $currentDate, callable $setCallback)
    {
        $date = $this->getProperty($data, $key, $currentDate);
        if ($date !== null) {
            if (is_string($date)) {
                $date = new DateTime($data[$key]);
            }
            call_user_func($setCallback, $date);
        }
    }
protected function setDate ( $ data , $ key , DateTIme $ currentDate , callable $ setCallback ) { $ date = $ this -> getProperty ( $ data , $ key , $ currentDate ) ; if ( $ date !== null ) { if ( is_string ( $ date ) ) { $ date = new DateTime ( $ data [ $ key ] ) ; } call_user_func ( $ setCallback , $ date ) ; } }
Sets a date if it's set in data.

@param array$data
@param string $key
@param DateTIme|null $currentDate
@param callable $setCallback
Sets a date if it s set in data .