original_string: public function can_uninstall_plugin($component) {
  
          $pluginfo = $this->get_plugin_info($component);
  
          if (is_null($pluginfo)) {
              return false;
          }
  
          if (!$this->common_uninstall_check($pluginfo)) {
              return false;
          }
  
          // Verify only if something else requires the subplugins, do not verify their common_uninstall_check()!
          $subplugins = $this->get_subplugins_of_plugin($pluginfo->component);
          foreach ($subplugins as $subpluginfo) {
              // Check if there are some other plugins requiring this subplugin
              // (but the parent and siblings).
              foreach ($this->other_plugins_that_require($subpluginfo->component) as $requiresme) {
                  $ismyparent = ($pluginfo->component === $requiresme);
                  $ismysibling = in_array($requiresme, array_keys($subplugins));
                  if (!$ismyparent and !$ismysibling) {
                      return false;
                  }
              }
          }
  
          // Check if there are some other plugins requiring this plugin
          // (but its subplugins).
          foreach ($this->other_plugins_that_require($pluginfo->component) as $requiresme) {
              $ismysubplugin = in_array($requiresme, array_keys($subplugins));
              if (!$ismysubplugin) {
                  return false;
              }
          }
  
          return true;
      }
code: public function can_uninstall_plugin($component) {
  
          $pluginfo = $this->get_plugin_info($component);
  
          if (is_null($pluginfo)) {
              return false;
          }
  
          if (!$this->common_uninstall_check($pluginfo)) {
              return false;
          }
  
          // Verify only if something else requires the subplugins, do not verify their common_uninstall_check()!
          $subplugins = $this->get_subplugins_of_plugin($pluginfo->component);
          foreach ($subplugins as $subpluginfo) {
              // Check if there are some other plugins requiring this subplugin
              // (but the parent and siblings).
              foreach ($this->other_plugins_that_require($subpluginfo->component) as $requiresme) {
                  $ismyparent = ($pluginfo->component === $requiresme);
                  $ismysibling = in_array($requiresme, array_keys($subplugins));
                  if (!$ismyparent and !$ismysibling) {
                      return false;
                  }
              }
          }
  
          // Check if there are some other plugins requiring this plugin
          // (but its subplugins).
          foreach ($this->other_plugins_that_require($pluginfo->component) as $requiresme) {
              $ismysubplugin = in_array($requiresme, array_keys($subplugins));
              if (!$ismysubplugin) {
                  return false;
              }
          }
  
          return true;
      }
code_tokens: public function can_uninstall_plugin ( $ component ) { $ pluginfo = $ this -> get_plugin_info ( $ component ) ; if ( is_null ( $ pluginfo ) ) { return false ; } if ( ! $ this -> common_uninstall_check ( $ pluginfo ) ) { return false ; } // Verify only if something else requires the subplugins, do not verify their common_uninstall_check()! $ subplugins = $ this -> get_subplugins_of_plugin ( $ pluginfo -> component ) ; foreach ( $ subplugins as $ subpluginfo ) { // Check if there are some other plugins requiring this subplugin // (but the parent and siblings). foreach ( $ this -> other_plugins_that_require ( $ subpluginfo -> component ) as $ requiresme ) { $ ismyparent = ( $ pluginfo -> component === $ requiresme ) ; $ ismysibling = in_array ( $ requiresme , array_keys ( $ subplugins ) ) ; if ( ! $ ismyparent and ! $ ismysibling ) { return false ; } } } // Check if there are some other plugins requiring this plugin // (but its subplugins). foreach ( $ this -> other_plugins_that_require ( $ pluginfo -> component ) as $ requiresme ) { $ ismysubplugin = in_array ( $ requiresme , array_keys ( $ subplugins ) ) ; if ( ! $ ismysubplugin ) { return false ; } } return true ; }
docstring: Is it possible to uninstall the given plugin?
  
  False is returned if the plugininfo subclass declares the uninstall should
  not be allowed via {@link \core\plugininfo\base::is_uninstall_allowed()} or if the
  core vetoes it (e.g. becase the plugin or some of its subplugins is required
  by some other installed plugin).
  
  @param string $component full frankenstyle name, e.g. mod_foobar
  @return bool
docstring_tokens: Is it possible to uninstall the given plugin?