protected function replaceKeyPlaceholders()
    {
        if ( ! $this->model) {
            return $this;
        }

        $placeholder = static::MODEL_KEY_PLACEHOLDER;

        foreach ($this->rules as $key => &$ruleSet) {

            if (is_string($ruleSet)) {

                $ruleSet = str_replace($placeholder, $this->model->getKey(), $ruleSet);
                continue;
            }

            if (is_array($ruleSet)) {

                foreach ($ruleSet as &$rule) {
                    $rule = str_replace($placeholder, $this->model->getKey(), $rule);
                }

                unset($rule);
            }
        }

        unset($ruleSet);

        return $this;
    }
protected function replaceKeyPlaceholders()
    {
        if ( ! $this->model) {
            return $this;
        }

        $placeholder = static::MODEL_KEY_PLACEHOLDER;

        foreach ($this->rules as $key => &$ruleSet) {

            if (is_string($ruleSet)) {

                $ruleSet = str_replace($placeholder, $this->model->getKey(), $ruleSet);
                continue;
            }

            if (is_array($ruleSet)) {

                foreach ($ruleSet as &$rule) {
                    $rule = str_replace($placeholder, $this->model->getKey(), $rule);
                }

                unset($rule);
            }
        }

        unset($ruleSet);

        return $this;
    }
protected function replaceKeyPlaceholders ( ) { if ( ! $ this -> model ) { return $ this ; } $ placeholder = static :: MODEL_KEY_PLACEHOLDER ; foreach ( $ this -> rules as $ key => & $ ruleSet ) { if ( is_string ( $ ruleSet ) ) { $ ruleSet = str_replace ( $ placeholder , $ this -> model -> getKey ( ) , $ ruleSet ) ; continue ; } if ( is_array ( $ ruleSet ) ) { foreach ( $ ruleSet as & $ rule ) { $ rule = str_replace ( $ placeholder , $ this -> model -> getKey ( ) , $ rule ) ; } unset ( $ rule ) ; } } unset ( $ ruleSet ) ; return $ this ; }
Decorates rules by replacing a model key value placeholder.

@return $this
Decorates rules by replacing a model key value placeholder .