original_string: public function installPluginIntoMoodle(MoodlePlugin $plugin)
      {
          $this->getOutput()->info(sprintf('Installing %s', $plugin->getComponent()));
  
          $directory = $this->moodle->getComponentInstallDirectory($plugin->getComponent());
  
          if (is_dir($directory)) {
              throw new \RuntimeException('Plugin is already installed in standard Moodle');
          }
  
          $this->getOutput()->info(sprintf('Copying plugin from %s to %s', $plugin->directory, $directory));
  
          // Install the plugin.
          $filesystem = new Filesystem();
          $filesystem->mirror($plugin->directory, $directory);
  
          return $directory;
      }
code: public function installPluginIntoMoodle(MoodlePlugin $plugin)
      {
          $this->getOutput()->info(sprintf('Installing %s', $plugin->getComponent()));
  
          $directory = $this->moodle->getComponentInstallDirectory($plugin->getComponent());
  
          if (is_dir($directory)) {
              throw new \RuntimeException('Plugin is already installed in standard Moodle');
          }
  
          $this->getOutput()->info(sprintf('Copying plugin from %s to %s', $plugin->directory, $directory));
  
          // Install the plugin.
          $filesystem = new Filesystem();
          $filesystem->mirror($plugin->directory, $directory);
  
          return $directory;
      }
code_tokens: public function installPluginIntoMoodle ( MoodlePlugin $ plugin ) { $ this -> getOutput ( ) -> info ( sprintf ( 'Installing %s' , $ plugin -> getComponent ( ) ) ) ; $ directory = $ this -> moodle -> getComponentInstallDirectory ( $ plugin -> getComponent ( ) ) ; if ( is_dir ( $ directory ) ) { throw new \ RuntimeException ( 'Plugin is already installed in standard Moodle' ) ; } $ this -> getOutput ( ) -> info ( sprintf ( 'Copying plugin from %s to %s' , $ plugin -> directory , $ directory ) ) ; // Install the plugin. $ filesystem = new Filesystem ( ) ; $ filesystem -> mirror ( $ plugin -> directory , $ directory ) ; return $ directory ; }
docstring: Install the plugin into Moodle.
  
  @param MoodlePlugin $plugin
  
  @return string
docstring_tokens: Install the plugin into Moodle .