PhpSchool\CliMenu\CliMenuBuilder::end PHP Method

end() public method

Return to parent builder
public end ( ) : CliMenuBuilder
return CliMenuBuilder
    public function end()
    {
        if (null === $this->parent) {
            throw new RuntimeException('No parent builder to return to');
        }
        return $this->parent;
    }

Usage Example

Example #1
0
 public function testEndThrowsExceptionIfNoParentBuilder()
 {
     $builder = new CliMenuBuilder();
     $this->setExpectedException(RuntimeException::class, 'No parent builder to return to');
     $builder->end();
 }