original_string: public function replaceAll($stack, $resetBodyKey = true)
      {
          if (! $stack instanceof DataCollection) {
              $stack = new DataCollection($stack);
          }
  
          $this->stack = $stack;
  
          if ($resetBodyKey) {
              $this->bodyKey = null;
  
              foreach ($stack as $key => $view) {
                  if ($view->getType() === View::PART_BODY_PLACEHOLDER) {
                      $this->bodyKey = $key;
                  }
              }
          }
      }
code: public function replaceAll($stack, $resetBodyKey = true)
      {
          if (! $stack instanceof DataCollection) {
              $stack = new DataCollection($stack);
          }
  
          $this->stack = $stack;
  
          if ($resetBodyKey) {
              $this->bodyKey = null;
  
              foreach ($stack as $key => $view) {
                  if ($view->getType() === View::PART_BODY_PLACEHOLDER) {
                      $this->bodyKey = $key;
                  }
              }
          }
      }
code_tokens: public function replaceAll ( $ stack , $ resetBodyKey = true ) { if ( ! $ stack instanceof DataCollection ) { $ stack = new DataCollection ( $ stack ) ; } $ this -> stack = $ stack ; if ( $ resetBodyKey ) { $ this -> bodyKey = null ; foreach ( $ stack as $ key => $ view ) { if ( $ view -> getType ( ) === View :: PART_BODY_PLACEHOLDER ) { $ this -> bodyKey = $ key ; } } } }
docstring: Replace all stack items for the array given
  
  @param array|DataCollection $stack
  @param bool $resetBodyKey Reset the body placeholder. Will reindex the new stack for it.
docstring_tokens: Replace all stack items for the array given