original_string: protected function _getMaildirFiles($dh, $dirname, $default_flags = array())
      {
          while (($entry = readdir($dh)) !== false) {
              if ($entry[0] == '.' || !is_file($dirname . $entry)) {
                  continue;
              }
  
              @list($uniq, $info) = explode(':', $entry, 2);
              @list(,$size) = explode(',', $uniq, 2);
              if ($size && $size[0] == 'S' && $size[1] == '=') {
                  $size = substr($size, 2);
              }
              if (!ctype_digit($size)) {
                  $size = null;
              }
              @list($version, $flags) = explode(',', $info, 2);
              if ($version != 2) {
                  $flags = '';
              }
  
              $named_flags = $default_flags;
              $length = strlen($flags);
              for ($i = 0; $i < $length; ++$i) {
                  $flag = $flags[$i];
                  $named_flags[$flag] = isset(self::$_knownFlags[$flag]) ? self::$_knownFlags[$flag] : $flag;
              }
  
              $data = array('uniq'       => $uniq,
                            'flags'      => $named_flags,
                            'flaglookup' => array_flip($named_flags),
                            'filename'   => $dirname . $entry);
              if ($size !== null) {
                  $data['size'] = (int)$size;
              }
              $this->_files[] = $data;
          }
      }
code: protected function _getMaildirFiles($dh, $dirname, $default_flags = array())
      {
          while (($entry = readdir($dh)) !== false) {
              if ($entry[0] == '.' || !is_file($dirname . $entry)) {
                  continue;
              }
  
              @list($uniq, $info) = explode(':', $entry, 2);
              @list(,$size) = explode(',', $uniq, 2);
              if ($size && $size[0] == 'S' && $size[1] == '=') {
                  $size = substr($size, 2);
              }
              if (!ctype_digit($size)) {
                  $size = null;
              }
              @list($version, $flags) = explode(',', $info, 2);
              if ($version != 2) {
                  $flags = '';
              }
  
              $named_flags = $default_flags;
              $length = strlen($flags);
              for ($i = 0; $i < $length; ++$i) {
                  $flag = $flags[$i];
                  $named_flags[$flag] = isset(self::$_knownFlags[$flag]) ? self::$_knownFlags[$flag] : $flag;
              }
  
              $data = array('uniq'       => $uniq,
                            'flags'      => $named_flags,
                            'flaglookup' => array_flip($named_flags),
                            'filename'   => $dirname . $entry);
              if ($size !== null) {
                  $data['size'] = (int)$size;
              }
              $this->_files[] = $data;
          }
      }
code_tokens: protected function _getMaildirFiles ( $ dh , $ dirname , $ default_flags = array ( ) ) { while ( ( $ entry = readdir ( $ dh ) ) !== false ) { if ( $ entry [ 0 ] == '.' || ! is_file ( $ dirname . $ entry ) ) { continue ; } @ list ( $ uniq , $ info ) = explode ( ':' , $ entry , 2 ) ; @ list ( , $ size ) = explode ( ',' , $ uniq , 2 ) ; if ( $ size && $ size [ 0 ] == 'S' && $ size [ 1 ] == '=' ) { $ size = substr ( $ size , 2 ) ; } if ( ! ctype_digit ( $ size ) ) { $ size = null ; } @ list ( $ version , $ flags ) = explode ( ',' , $ info , 2 ) ; if ( $ version != 2 ) { $ flags = '' ; } $ named_flags = $ default_flags ; $ length = strlen ( $ flags ) ; for ( $ i = 0 ; $ i < $ length ; ++ $ i ) { $ flag = $ flags [ $ i ] ; $ named_flags [ $ flag ] = isset ( self :: $ _knownFlags [ $ flag ] ) ? self :: $ _knownFlags [ $ flag ] : $ flag ; } $ data = array ( 'uniq' => $ uniq , 'flags' => $ named_flags , 'flaglookup' => array_flip ( $ named_flags ) , 'filename' => $ dirname . $ entry ) ; if ( $ size !== null ) { $ data [ 'size' ] = ( int ) $ size ; } $ this -> _files [ ] = $ data ; } }
docstring: find all files in opened dir handle and add to maildir files
  
  @param resource $dh            dir handle used for search
  @param string   $dirname       dirname of dir in $dh
  @param array    $default_flags default flags for given dir
  @return null
docstring_tokens: find all files in opened dir handle and add to maildir files