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