original_string: public function resolve_requirements(\core\plugininfo\base $plugin, $moodleversion=null, $moodlebranch=null) {
          global $CFG;
  
          if ($plugin->versiondisk === null) {
              // Missing from disk, we have no version.php to read from.
              return array();
          }
  
          if ($moodleversion === null) {
              $moodleversion = $CFG->version;
          }
  
          if ($moodlebranch === null) {
              $moodlebranch = $CFG->branch;
          }
  
          $reqs = array();
          $reqcore = $this->resolve_core_requirements($plugin, $moodleversion);
  
          if (!empty($reqcore)) {
              $reqs['core'] = $reqcore;
          }
  
          foreach ($plugin->get_other_required_plugins() as $reqplug => $reqver) {
              $reqs[$reqplug] = $this->resolve_dependency_requirements($plugin, $reqplug, $reqver, $moodlebranch);
          }
  
          return $reqs;
      }
code: public function resolve_requirements(\core\plugininfo\base $plugin, $moodleversion=null, $moodlebranch=null) {
          global $CFG;
  
          if ($plugin->versiondisk === null) {
              // Missing from disk, we have no version.php to read from.
              return array();
          }
  
          if ($moodleversion === null) {
              $moodleversion = $CFG->version;
          }
  
          if ($moodlebranch === null) {
              $moodlebranch = $CFG->branch;
          }
  
          $reqs = array();
          $reqcore = $this->resolve_core_requirements($plugin, $moodleversion);
  
          if (!empty($reqcore)) {
              $reqs['core'] = $reqcore;
          }
  
          foreach ($plugin->get_other_required_plugins() as $reqplug => $reqver) {
              $reqs[$reqplug] = $this->resolve_dependency_requirements($plugin, $reqplug, $reqver, $moodlebranch);
          }
  
          return $reqs;
      }
code_tokens: public function resolve_requirements ( \ core \ plugininfo \ base $ plugin , $ moodleversion = null , $ moodlebranch = null ) { global $ CFG ; if ( $ plugin -> versiondisk === null ) { // Missing from disk, we have no version.php to read from. return array ( ) ; } if ( $ moodleversion === null ) { $ moodleversion = $ CFG -> version ; } if ( $ moodlebranch === null ) { $ moodlebranch = $ CFG -> branch ; } $ reqs = array ( ) ; $ reqcore = $ this -> resolve_core_requirements ( $ plugin , $ moodleversion ) ; if ( ! empty ( $ reqcore ) ) { $ reqs [ 'core' ] = $ reqcore ; } foreach ( $ plugin -> get_other_required_plugins ( ) as $ reqplug => $ reqver ) { $ reqs [ $ reqplug ] = $ this -> resolve_dependency_requirements ( $ plugin , $ reqplug , $ reqver , $ moodlebranch ) ; } return $ reqs ; }
docstring: Resolve requirements and dependencies of a plugin.
  
  Returns an array of objects describing the requirement/dependency,
  indexed by the frankenstyle name of the component. The returned array
  can be empty. The objects in the array have following properties:
  
  ->(numeric)hasver
  ->(numeric)reqver
  ->(string)status
  ->(string)availability
  
  @param \core\plugininfo\base $plugin the plugin we are checking
  @param null|string|int|double $moodleversion explicit moodle core version to check against, defaults to $CFG->version
  @param null|string|int $moodlebranch explicit moodle core branch to check against, defaults to $CFG->branch
  @return array of objects
docstring_tokens: Resolve requirements and dependencies of a plugin .