original_string: public function setWordPressInstallDirectory(PackageEvent $event)
      {
          if ($this->getPackageName($event) != 'johnpbloch/wordpress') {
              return;
          }
          
          $composer = $event->getComposer();
          $rootPkg = $composer->getPackage();
          
          if (! $rootPkg) {
              return;
          }
          
          $extra = $rootPkg->getExtra();
          
          if (isset($extra['wordpress-install-dir']) && $extra['wordpress-install-dir']) {
              return;
          }
          
          $extra['wordpress-install-dir'] = static::$plugin->getPublicDirectory() . '/wp';
          
          $rootPkg->setExtra($extra);
          $composer->setPackage($rootPkg);
      }
code: public function setWordPressInstallDirectory(PackageEvent $event)
      {
          if ($this->getPackageName($event) != 'johnpbloch/wordpress') {
              return;
          }
          
          $composer = $event->getComposer();
          $rootPkg = $composer->getPackage();
          
          if (! $rootPkg) {
              return;
          }
          
          $extra = $rootPkg->getExtra();
          
          if (isset($extra['wordpress-install-dir']) && $extra['wordpress-install-dir']) {
              return;
          }
          
          $extra['wordpress-install-dir'] = static::$plugin->getPublicDirectory() . '/wp';
          
          $rootPkg->setExtra($extra);
          $composer->setPackage($rootPkg);
      }
code_tokens: public function setWordPressInstallDirectory ( PackageEvent $ event ) { if ( $ this -> getPackageName ( $ event ) != 'johnpbloch/wordpress' ) { return ; } $ composer = $ event -> getComposer ( ) ; $ rootPkg = $ composer -> getPackage ( ) ; if ( ! $ rootPkg ) { return ; } $ extra = $ rootPkg -> getExtra ( ) ; if ( isset ( $ extra [ 'wordpress-install-dir' ] ) && $ extra [ 'wordpress-install-dir' ] ) { return ; } $ extra [ 'wordpress-install-dir' ] = static :: $ plugin -> getPublicDirectory ( ) . '/wp' ; $ rootPkg -> setExtra ( $ extra ) ; $ composer -> setPackage ( $ rootPkg ) ; }
docstring: Set the WordPress installation directory.
  
  @param  \Composer\EventDispatcher\Event $event
  @return void
docstring_tokens: Set the WordPress installation directory .