original_string: public static function setPermissions(Event $event)
      {
          $options = array_merge(
              array(
                  self::PARAM_WRITABLE => array(),
                  self::PARAM_EXECUTABLE => array(),
              ),
              $event->getComposer()->getPackage()->getExtra()
          );
  
          foreach ((array)$options[self::PARAM_WRITABLE] as $path) {
              echo "Setting writable: $path ...";
              if (is_dir($path)) {
                  chmod($path, 0777);
                  echo "done\n";
              } else {
                  echo "The directory was not found: " . getcwd() . DIRECTORY_SEPARATOR . $path;
                  return;
              }
          }
  
          foreach ((array)$options[self::PARAM_EXECUTABLE] as $path) {
              echo "Setting executable: $path ... ";
              if (is_file($path)) {
                  chmod($path, 0755);
                  echo "done\n";
              } else {
                  echo "\n\tThe file was not found: " . getcwd() . DIRECTORY_SEPARATOR . $path . "\n";
                  return;
              }
          }
      }
code: public static function setPermissions(Event $event)
      {
          $options = array_merge(
              array(
                  self::PARAM_WRITABLE => array(),
                  self::PARAM_EXECUTABLE => array(),
              ),
              $event->getComposer()->getPackage()->getExtra()
          );
  
          foreach ((array)$options[self::PARAM_WRITABLE] as $path) {
              echo "Setting writable: $path ...";
              if (is_dir($path)) {
                  chmod($path, 0777);
                  echo "done\n";
              } else {
                  echo "The directory was not found: " . getcwd() . DIRECTORY_SEPARATOR . $path;
                  return;
              }
          }
  
          foreach ((array)$options[self::PARAM_EXECUTABLE] as $path) {
              echo "Setting executable: $path ... ";
              if (is_file($path)) {
                  chmod($path, 0755);
                  echo "done\n";
              } else {
                  echo "\n\tThe file was not found: " . getcwd() . DIRECTORY_SEPARATOR . $path . "\n";
                  return;
              }
          }
      }
code_tokens: public static function setPermissions ( Event $ event ) { $ options = array_merge ( array ( self :: PARAM_WRITABLE => array ( ) , self :: PARAM_EXECUTABLE => array ( ) , ) , $ event -> getComposer ( ) -> getPackage ( ) -> getExtra ( ) ) ; foreach ( ( array ) $ options [ self :: PARAM_WRITABLE ] as $ path ) { echo "Setting writable: $path ..." ; if ( is_dir ( $ path ) ) { chmod ( $ path , 0777 ) ; echo "done\n" ; } else { echo "The directory was not found: " . getcwd ( ) . DIRECTORY_SEPARATOR . $ path ; return ; } } foreach ( ( array ) $ options [ self :: PARAM_EXECUTABLE ] as $ path ) { echo "Setting executable: $path ... " ; if ( is_file ( $ path ) ) { chmod ( $ path , 0755 ) ; echo "done\n" ; } else { echo "\n\tThe file was not found: " . getcwd ( ) . DIRECTORY_SEPARATOR . $ path . "\n" ; return ; } } }
docstring: Sets the correct permissions of files and directories.
  @param Event $event
docstring_tokens: Sets the correct permissions of files and directories .