original_string: public static function get_rule($ruleorid) {
          global $DB;
          if (!is_object($ruleorid)) {
              $rule = $DB->get_record('tool_monitor_rules', array('id' => $ruleorid), '*', MUST_EXIST);
          } else {
              $rule = $ruleorid;
          }
  
          return new rule($rule);
      }
code: public static function get_rule($ruleorid) {
          global $DB;
          if (!is_object($ruleorid)) {
              $rule = $DB->get_record('tool_monitor_rules', array('id' => $ruleorid), '*', MUST_EXIST);
          } else {
              $rule = $ruleorid;
          }
  
          return new rule($rule);
      }
code_tokens: public static function get_rule ( $ ruleorid ) { global $ DB ; if ( ! is_object ( $ ruleorid ) ) { $ rule = $ DB -> get_record ( 'tool_monitor_rules' , array ( 'id' => $ ruleorid ) , '*' , MUST_EXIST ) ; } else { $ rule = $ ruleorid ; } return new rule ( $ rule ) ; }
docstring: Get an instance of rule class.
  
  @param \stdClass|int $ruleorid A rule object from database or rule id.
  
  @return rule object with rule id.
docstring_tokens: Get an instance of rule class .