original_string: public static function get_cartridge_url($tool) {
          global $CFG;
          $url = null;
  
          $id = $tool->id;
          $token = self::generate_cartridge_token($tool->id);
          if ($CFG->slasharguments) {
              $url = new \moodle_url('/enrol/lti/cartridge.php/' . $id . '/' . $token . '/cartridge.xml');
          } else {
              $url = new \moodle_url('/enrol/lti/cartridge.php',
                      array(
                          'id' => $id,
                          'token' => $token
                      )
                  );
          }
          return $url;
      }
code: public static function get_cartridge_url($tool) {
          global $CFG;
          $url = null;
  
          $id = $tool->id;
          $token = self::generate_cartridge_token($tool->id);
          if ($CFG->slasharguments) {
              $url = new \moodle_url('/enrol/lti/cartridge.php/' . $id . '/' . $token . '/cartridge.xml');
          } else {
              $url = new \moodle_url('/enrol/lti/cartridge.php',
                      array(
                          'id' => $id,
                          'token' => $token
                      )
                  );
          }
          return $url;
      }
code_tokens: public static function get_cartridge_url ( $ tool ) { global $ CFG ; $ url = null ; $ id = $ tool -> id ; $ token = self :: generate_cartridge_token ( $ tool -> id ) ; if ( $ CFG -> slasharguments ) { $ url = new \ moodle_url ( '/enrol/lti/cartridge.php/' . $ id . '/' . $ token . '/cartridge.xml' ) ; } else { $ url = new \ moodle_url ( '/enrol/lti/cartridge.php' , array ( 'id' => $ id , 'token' => $ token ) ) ; } return $ url ; }
docstring: Returns the url to the cartridge representing the tool.
  
  If you have slash arguments enabled, this will be a nice url ending in cartridge.xml.
  If not it will be a php page with some parameters passed.
  
  @param \stdClass $tool The lti tool
  @return string The url to the cartridge representing the tool
  @since Moodle 3.2
docstring_tokens: Returns the url to the cartridge representing the tool .