original_string: protected function _disable(PluginPackage $plugin)
      {
          $requiredBy = Plugin::checkReverseDependency($plugin->name);
          if (!empty($requiredBy)) {
              $names = [];
              foreach ($requiredBy as $p) {
                  $names[] = $p->name();
              }
  
              $this->err(__d('installer', 'Plugin "{0}" cannot be disabled as it is required by: {1}', $plugin->humanName, implode(', ', $names)));
  
              return false;
          }
  
          if (!$this->params['no-callbacks']) {
              $trigger = $this->_triggerBeforeEvents($plugin);
              if (!$trigger) {
                  return false;
              }
          }
  
          return $this->_finish($plugin);
      }
code: protected function _disable(PluginPackage $plugin)
      {
          $requiredBy = Plugin::checkReverseDependency($plugin->name);
          if (!empty($requiredBy)) {
              $names = [];
              foreach ($requiredBy as $p) {
                  $names[] = $p->name();
              }
  
              $this->err(__d('installer', 'Plugin "{0}" cannot be disabled as it is required by: {1}', $plugin->humanName, implode(', ', $names)));
  
              return false;
          }
  
          if (!$this->params['no-callbacks']) {
              $trigger = $this->_triggerBeforeEvents($plugin);
              if (!$trigger) {
                  return false;
              }
          }
  
          return $this->_finish($plugin);
      }
code_tokens: protected function _disable ( PluginPackage $ plugin ) { $ requiredBy = Plugin :: checkReverseDependency ( $ plugin -> name ) ; if ( ! empty ( $ requiredBy ) ) { $ names = [ ] ; foreach ( $ requiredBy as $ p ) { $ names [ ] = $ p -> name ( ) ; } $ this -> err ( __d ( 'installer' , 'Plugin "{0}" cannot be disabled as it is required by: {1}' , $ plugin -> humanName , implode ( ', ' , $ names ) ) ) ; return false ; } if ( ! $ this -> params [ 'no-callbacks' ] ) { $ trigger = $ this -> _triggerBeforeEvents ( $ plugin ) ; if ( ! $ trigger ) { return false ; } } return $ this -> _finish ( $ plugin ) ; }
docstring: Disables the given plugin.
  
  @param \CMS\Core\Package\PluginPackage $plugin The plugin to disable
  @return bool True on success
docstring_tokens: Disables the given plugin .