src/Renderer.php
public function endsection(string $name = null): void
    {
        // You can specify the section name for sanity-check purpose.
        if (! is_null($name) && $this->sectionStack[0] != $name) {
            throw new \LogicException('unmatched end-section: ' . $name . ', expects: ' . $this->sectionStack[0]);
        }

        $output = ob_get_clean();

        $name = array_shift($this->sectionStack);
        $this->sections[$name] = $output;
    }
public function endsection(string $name = null): void
    {
        // You can specify the section name for sanity-check purpose.
        if (! is_null($name) && $this->sectionStack[0] != $name) {
            throw new \LogicException('unmatched end-section: ' . $name . ', expects: ' . $this->sectionStack[0]);
        }

        $output = ob_get_clean();

        $name = array_shift($this->sectionStack);
        $this->sections[$name] = $output;
    }
public function endsection ( string $ name = null ) : void { // You can specify the section name for sanity-check purpose. if ( ! is_null ( $ name ) && $ this -> sectionStack [ 0 ] != $ name ) { throw new \ LogicException ( 'unmatched end-section: ' . $ name . ', expects: ' . $ this -> sectionStack [ 0 ] ) ; } $ output = ob_get_clean ( ) ; $ name = array_shift ( $ this -> sectionStack ) ; $ this -> sections [ $ name ] = $ output ; }
End section.

The `$name` parameter, if passed, is used to check section sanity.
When the passed name is different from the current section, then renderer throws runtime exception.

@param string|null $name the section name
@return void
End section .