src/MarkdownIt/Ruler.php
public function enable($list, $ignoreInvalid=false)
     {
        if (!is_array($list)) { $list = [ $list ]; }

        $result = [];

         // Search by $name and enable
         foreach ($list as &$name){
             $idx = $this->__find__($name);

             if ($idx < 0) {
                 if ($ignoreInvalid) continue;
                 throw new \Exception("Rules manager: invalid rule name '{$name}''");
             }
             $this->__rules__[$idx]->enabled = true;
             $result[] = $name;
         }

        $this->__cache__ = null;
        return $result;
    }
public function enable($list, $ignoreInvalid=false)
     {
        if (!is_array($list)) { $list = [ $list ]; }

        $result = [];

         // Search by $name and enable
         foreach ($list as &$name){
             $idx = $this->__find__($name);

             if ($idx < 0) {
                 if ($ignoreInvalid) continue;
                 throw new \Exception("Rules manager: invalid rule name '{$name}''");
             }
             $this->__rules__[$idx]->enabled = true;
             $result[] = $name;
         }

        $this->__cache__ = null;
        return $result;
    }
public function enable ( $ list , $ ignoreInvalid = false ) { if ( ! is_array ( $ list ) ) { $ list = [ $ list ] ; } $ result = [ ] ; // Search by $name and enable foreach ( $ list as & $ name ) { $ idx = $ this -> __find__ ( $ name ) ; if ( $ idx < 0 ) { if ( $ ignoreInvalid ) continue ; throw new \ Exception ( "Rules manager: invalid rule name '{$name}''" ) ; } $ this -> __rules__ [ $ idx ] -> enabled = true ; $ result [ ] = $ name ; } $ this -> __cache__ = null ; return $ result ; }
Enable rules with given names. If any rule name not found - throw Error.
Errors can be disabled by second param.

Returns list of found rule names (if no exception happened).

See also [[Ruler.disable]], [[Ruler.enableOnly]].
@param string|array $list          list of rule names to enable.
@param boolean      $ignoreInvalid set `true` to ignore errors when $rule not found.
@return array
Enable rules with given names . If any rule name not found - throw Error . Errors can be disabled by second param .