getModeName(); $this->allowedModes = array_filter( ModeRegistry::getInstance()->getModesForCategories([ ModeRegistry::CATEGORY_FORMATTING, ModeRegistry::CATEGORY_SUBSTITION, ModeRegistry::CATEGORY_DISABLED, ]), static fn($mode) => $mode !== $self ); } /** @inheritdoc */ public function connectTo($mode) { // Can't nest formatting in itself if ($mode === $this->getModeName()) { return; } $this->Lexer->addEntryPattern( $this->getEntryPattern(), $mode, $this->getModeName() ); } /** @inheritdoc */ public function postConnect() { $this->Lexer->addExitPattern( $this->getExitPattern(), $this->getModeName() ); } }