original_string: public function addLoop($data)
      {
          $length = is_array($data) || $data instanceof Countable ? count($data) : null;
  
          $parent = Arr::last($this->loopsStack);
  
          $this->loopsStack[] = [
              'iteration' => 0,
              'index'     => 0,
              'remaining' => isset($length) ? $length : null,
              'count'     => $length,
              'first'     => true,
              'last'      => isset($length) ? $length === 1 : null,
              'depth'     => count($this->loopsStack) + 1,
              'parent'    => $parent ? (object) $parent : null,
          ];
      }
code: public function addLoop($data)
      {
          $length = is_array($data) || $data instanceof Countable ? count($data) : null;
  
          $parent = Arr::last($this->loopsStack);
  
          $this->loopsStack[] = [
              'iteration' => 0,
              'index'     => 0,
              'remaining' => isset($length) ? $length : null,
              'count'     => $length,
              'first'     => true,
              'last'      => isset($length) ? $length === 1 : null,
              'depth'     => count($this->loopsStack) + 1,
              'parent'    => $parent ? (object) $parent : null,
          ];
      }
code_tokens: public function addLoop ( $ data ) { $ length = is_array ( $ data ) || $ data instanceof Countable ? count ( $ data ) : null ; $ parent = Arr :: last ( $ this -> loopsStack ) ; $ this -> loopsStack [ ] = [ 'iteration' => 0 , 'index' => 0 , 'remaining' => isset ( $ length ) ? $ length : null , 'count' => $ length , 'first' => true , 'last' => isset ( $ length ) ? $ length === 1 : null , 'depth' => count ( $ this -> loopsStack ) + 1 , 'parent' => $ parent ? ( object ) $ parent : null , ] ; }
docstring: Add new loop to the stack.
  
  @param array|\Countable $data
  
  @return void
docstring_tokens: Add new loop to the stack .