Generator/PHPClassFile.php
protected function getSectionBlocks($section_type) {
    if ($section_type == 'constructor' && isset($this->constructor)) {
      // TODO: remove this special casing.
      $this->constructor = [$this->constructor];
    }

    $code_blocks = [];
    if (!empty($this->{$section_type})) {
      foreach ($this->{$section_type} as $component_name => $lines) {
        $code_blocks[] = $lines;
      }
    }

    return $code_blocks;
  }
protected function getSectionBlocks($section_type) {
    if ($section_type == 'constructor' && isset($this->constructor)) {
      // TODO: remove this special casing.
      $this->constructor = [$this->constructor];
    }

    $code_blocks = [];
    if (!empty($this->{$section_type})) {
      foreach ($this->{$section_type} as $component_name => $lines) {
        $code_blocks[] = $lines;
      }
    }

    return $code_blocks;
  }
protected function getSectionBlocks ( $ section_type ) { if ( $ section_type == 'constructor' && isset ( $ this -> constructor ) ) { // TODO: remove this special casing. $ this -> constructor = [ $ this -> constructor ] ; } $ code_blocks = [ ] ; if ( ! empty ( $ this -> { $ section_type } ) ) { foreach ( $ this -> { $ section_type } as $ component_name => $ lines ) { $ code_blocks [ ] = $ lines ; } } return $ code_blocks ; }
Returns the section blocks for the given section.

Helper for classCodeBody(). We consider that class code is made up of sections such as
properties, constructor, methods. Each section has multiple blocks, i.e. the multiple
properties or methods (the constructor is a special case).

For each type of section, we assemble an array of the blocks, where each block is an
array of code lines.

Merging these items, and merging the different sections takes place in
mergeSectionCode(), which takes care of spacing between items and spacing between
different sections.

@param string $section_type
A section type is a string identifying the type of the section, e.g. 'functions'.

@return array
An array of blocks
Returns the section blocks for the given section .