original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Decorates rules by replacing a model key value placeholder.
  
  @return $this
docstring_tokens: Decorates rules by replacing a model key value placeholder .