original_string: protected function sanitizeCommandArguments(array $arguments)
      {
          $args       = array();
          $files      = array();
          $fileMode   = false;
          foreach ($arguments as $k => $v) {
              if ($v === '--' || $k === '--') {
                  $fileMode   = true;
                  continue;
              }
              if (is_int($k)) {
                  if (strpos($v, '-') === 0) {
                      $args[]  = $this->sanitizeCommandArgument($v, null);
                  } else if ($fileMode) {
                      $files[] = escapeshellarg($v);
                  } else {
                      $args[]  = escapeshellarg($v);
                  }
              } else {
                  if (strpos($k, '-') === 0) {
                      $args[] = $this->sanitizeCommandArgument($k, $v);
                  }
              }
          }
          return array($args, $files);
      }
code: protected function sanitizeCommandArguments(array $arguments)
      {
          $args       = array();
          $files      = array();
          $fileMode   = false;
          foreach ($arguments as $k => $v) {
              if ($v === '--' || $k === '--') {
                  $fileMode   = true;
                  continue;
              }
              if (is_int($k)) {
                  if (strpos($v, '-') === 0) {
                      $args[]  = $this->sanitizeCommandArgument($v, null);
                  } else if ($fileMode) {
                      $files[] = escapeshellarg($v);
                  } else {
                      $args[]  = escapeshellarg($v);
                  }
              } else {
                  if (strpos($k, '-') === 0) {
                      $args[] = $this->sanitizeCommandArgument($k, $v);
                  }
              }
          }
          return array($args, $files);
      }
code_tokens: protected function sanitizeCommandArguments ( array $ arguments ) { $ args = array ( ) ; $ files = array ( ) ; $ fileMode = false ; foreach ( $ arguments as $ k => $ v ) { if ( $ v === '--' || $ k === '--' ) { $ fileMode = true ; continue ; } if ( is_int ( $ k ) ) { if ( strpos ( $ v , '-' ) === 0 ) { $ args [ ] = $ this -> sanitizeCommandArgument ( $ v , null ) ; } else if ( $ fileMode ) { $ files [ ] = escapeshellarg ( $ v ) ; } else { $ args [ ] = escapeshellarg ( $ v ) ; } } else { if ( strpos ( $ k , '-' ) === 0 ) { $ args [ ] = $ this -> sanitizeCommandArgument ( $ k , $ v ) ; } } } return array ( $ args , $ files ) ; }
docstring: Sanitizes a list of command line arguments and splits them into args and files
  
  @param   array       $arguments      The list of arguments
  @return  array                       An array with (args, files)
docstring_tokens: Sanitizes a list of command line arguments and splits them into args and files