original_string: public static function cleanUpOldModules(Event $event)
      {
          $composer = $event->getComposer();
          $requires = $composer->getPackage()->getRequires();
  
          $projectPath = str_replace('vendor/vkf/shop', '', $composer->getInstallationManager()->getInstallpath($composer->getPackage()));
          $modulePath = $projectPath . 'htdocs/modules';
          foreach (array('ra', 'vkf') as $renzelVendorDir) {
              foreach (glob($modulePath . '/' . $renzelVendorDir . '/*') as $file) {
                  if (is_dir($file)) {
                      $packageId = str_replace($modulePath . '/', '', $file);
                      if (!isset($requires[$packageId])) {
                          self::rmdir($file);
                          $event->getIO()->write('Deleted old package ' . $packageId);
                      }
                  }
              }
          }
      }
code: public static function cleanUpOldModules(Event $event)
      {
          $composer = $event->getComposer();
          $requires = $composer->getPackage()->getRequires();
  
          $projectPath = str_replace('vendor/vkf/shop', '', $composer->getInstallationManager()->getInstallpath($composer->getPackage()));
          $modulePath = $projectPath . 'htdocs/modules';
          foreach (array('ra', 'vkf') as $renzelVendorDir) {
              foreach (glob($modulePath . '/' . $renzelVendorDir . '/*') as $file) {
                  if (is_dir($file)) {
                      $packageId = str_replace($modulePath . '/', '', $file);
                      if (!isset($requires[$packageId])) {
                          self::rmdir($file);
                          $event->getIO()->write('Deleted old package ' . $packageId);
                      }
                  }
              }
          }
      }
code_tokens: public static function cleanUpOldModules ( Event $ event ) { $ composer = $ event -> getComposer ( ) ; $ requires = $ composer -> getPackage ( ) -> getRequires ( ) ; $ projectPath = str_replace ( 'vendor/vkf/shop' , '' , $ composer -> getInstallationManager ( ) -> getInstallpath ( $ composer -> getPackage ( ) ) ) ; $ modulePath = $ projectPath . 'htdocs/modules' ; foreach ( array ( 'ra' , 'vkf' ) as $ renzelVendorDir ) { foreach ( glob ( $ modulePath . '/' . $ renzelVendorDir . '/*' ) as $ file ) { if ( is_dir ( $ file ) ) { $ packageId = str_replace ( $ modulePath . '/' , '' , $ file ) ; if ( ! isset ( $ requires [ $ packageId ] ) ) { self :: rmdir ( $ file ) ; $ event -> getIO ( ) -> write ( 'Deleted old package ' . $ packageId ) ; } } } } }
docstring: cleanup deleted modules
  
  @param Event $event event
docstring_tokens: cleanup deleted modules