/** * Constructor. * * @param competency $competency The competency. */ public function __construct(competency $competency) { $class = $competency->get_ruletype(); if (!$class || !$this instanceof $class) { throw new coding_exception('This competency does not use this rule.'); } $this->competency = $competency; }