private function checkDateIsValid($date, $canBeNull = false)
    {
        if ($date === null
            && $canBeNull
        ) {
            return;
        }

        Date::factory($date);
    }
private function checkDateIsValid($date, $canBeNull = false)
    {
        if ($date === null
            && $canBeNull
        ) {
            return;
        }

        Date::factory($date);
    }
private function checkDateIsValid ( $ date , $ canBeNull = false ) { if ( $ date === null && $ canBeNull ) { return ; } Date :: factory ( $ date ) ; }
Utility function, makes sure date string is valid date, and throws if
otherwise.
Utility function makes sure date string is valid date and throws if otherwise .