private function fixRules($rules, $rule, $name, $realName, $subName)
    {
        if (isset($rules[$name])) {
            $key = array_search($name, array_keys($rules));

            $rules = array_slice($rules, 0, $key, true) +
                     array($realName.'_'.$subName => $rule) +
                     array_slice($rules, $key, count($rules) - $key, true);
        }

        return $rules;
    }
private function fixRules($rules, $rule, $name, $realName, $subName)
    {
        if (isset($rules[$name])) {
            $key = array_search($name, array_keys($rules));

            $rules = array_slice($rules, 0, $key, true) +
                     array($realName.'_'.$subName => $rule) +
                     array_slice($rules, $key, count($rules) - $key, true);
        }

        return $rules;
    }
private function fixRules ( $ rules , $ rule , $ name , $ realName , $ subName ) { if ( isset ( $ rules [ $ name ] ) ) { $ key = array_search ( $ name , array_keys ( $ rules ) ) ; $ rules = array_slice ( $ rules , 0 , $ key , true ) + array ( $ realName . '_' . $ subName => $ rule ) + array_slice ( $ rules , $ key , count ( $ rules ) - $ key , true ) ; } return $ rules ; }
Modifies the ruleset so that dynamically created
subrules are added to their original position.

@param array $rules
@param string $rule
@param string $name
@param string $realName
@param string $subName
@return array
Modifies the ruleset so that dynamically created subrules are added to their original position .