/** * Adds a bbcode to the parser * @param BBCode $bbcode * @param bool $replace If to replace another bbcode which is for the same tag * @return bool */ public function add_bbcode(BBCode $bbcode, $replace = true) { if (!$replace && isset($this->bbcodes[$bbcode->tag()])) { return false; } $this->bbcodes[$bbcode->tag()] = $bbcode; return true; }