Parser/Rules.php
public function replace(Rule $replacement, $type, $index = 0)
    {
        $current = $this->rule($type, $index);
        if ($current->name !== null) {
            $replacement->name = $current->name;
        }

        $this[$type][$index] = $replacement;
    }
public function replace(Rule $replacement, $type, $index = 0)
    {
        $current = $this->rule($type, $index);
        if ($current->name !== null) {
            $replacement->name = $current->name;
        }

        $this[$type][$index] = $replacement;
    }
public function replace ( Rule $ replacement , $ type , $ index = 0 ) { $ current = $ this -> rule ( $ type , $ index ) ; if ( $ current -> name !== null ) { $ replacement -> name = $ current -> name ; } $ this [ $ type ] [ $ index ] = $ replacement ; }
Replaces rule of given type and index with provided one.

@param Rule $replacement
@param      $type
@param int  $index
Replaces rule of given type and index with provided one .