original_string: public function chmod($files, $mode, $umask = 0000, $recursive = false)
      {
          foreach ($this->toIterable($files) as $file) {
              if (true !== @chmod($file, $mode & ~$umask)) {
                  throw new IOException(sprintf('Failed to chmod file "%s".', $file), 0, null, $file);
              }
              if ($recursive && is_dir($file) && !is_link($file)) {
                  $this->chmod(new \FilesystemIterator($file), $mode, $umask, true);
              }
          }
      }
code: public function chmod($files, $mode, $umask = 0000, $recursive = false)
      {
          foreach ($this->toIterable($files) as $file) {
              if (true !== @chmod($file, $mode & ~$umask)) {
                  throw new IOException(sprintf('Failed to chmod file "%s".', $file), 0, null, $file);
              }
              if ($recursive && is_dir($file) && !is_link($file)) {
                  $this->chmod(new \FilesystemIterator($file), $mode, $umask, true);
              }
          }
      }
code_tokens: public function chmod ( $ files , $ mode , $ umask = 0000 , $ recursive = false ) { foreach ( $ this -> toIterable ( $ files ) as $ file ) { if ( true !== @ chmod ( $ file , $ mode & ~ $ umask ) ) { throw new IOException ( sprintf ( 'Failed to chmod file "%s".' , $ file ) , 0 , null , $ file ) ; } if ( $ recursive && is_dir ( $ file ) && ! is_link ( $ file ) ) { $ this -> chmod ( new \ FilesystemIterator ( $ file ) , $ mode , $ umask , true ) ; } } }
docstring: Change mode for an array of files or directories.
  
  @param string|iterable $files     A filename, an array of files, or a \Traversable instance to change mode
  @param int             $mode      The new mode (octal)
  @param int             $umask     The mode mask (octal)
  @param bool            $recursive Whether change the mod recursively or not
  
  @throws IOException When the change fails
docstring_tokens: Change mode for an array of files or directories .