for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpSchool\CliMenu\Builder;
use PhpSchool\CliMenu\CliMenu;
use PhpSchool\CliMenu\MenuItem\SplitItem;
use PhpSchool\CliMenu\MenuStyle;
use PhpSchool\Terminal\Terminal;
/**
* @author Aydin Hassan <[email protected]>
*/
class SplitItemBuilder implements Builder
{
use BuilderUtils;
public function __construct(Builder $parent)
$this->parent = $parent;
parent
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
public function build() : SplitItem
$items = $this->buildSubMenus($this->menuItems);
return new SplitItem($items);
public function setSubMenuParents(CliMenu $menu) : void
foreach ($this->subMenus as $subMenu) {
$subMenu->setParent($menu);
public function getTerminal() : Terminal
return $this->parent->getTerminal();
public function getMenuStyle() : MenuStyle
return $this->parent->getMenuStyle();
public function end() : CliMenuBuilder
return $this->parent;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: