original_string: private function parseDate($rawDate)
      {
          foreach (['Y-m-d', 'Y-m', 'Y'] as $dateFormat) {
              $publishedDate = DateTime::createFromFormat($dateFormat.'|', $rawDate);
              if ($publishedDate !== false) {
                  break;
              }
          }
  
          if ($publishedDate === false) {
              $publishedDate = null;
          }
  
          return [$publishedDate, $dateFormat];
      }
code: private function parseDate($rawDate)
      {
          foreach (['Y-m-d', 'Y-m', 'Y'] as $dateFormat) {
              $publishedDate = DateTime::createFromFormat($dateFormat.'|', $rawDate);
              if ($publishedDate !== false) {
                  break;
              }
          }
  
          if ($publishedDate === false) {
              $publishedDate = null;
          }
  
          return [$publishedDate, $dateFormat];
      }
code_tokens: private function parseDate ( $ rawDate ) { foreach ( [ 'Y-m-d' , 'Y-m' , 'Y' ] as $ dateFormat ) { $ publishedDate = DateTime :: createFromFormat ( $ dateFormat . '|' , $ rawDate ) ; if ( $ publishedDate !== false ) { break ; } } if ( $ publishedDate === false ) { $ publishedDate = null ; } return [ $ publishedDate , $ dateFormat ] ; }
docstring: Parse the publication date.
  
  @param string $rawDate
  
  @return array The publication in DateTime and the date format
docstring_tokens: Parse the publication date .