for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpSchool\CliMenu\MenuItem;
use Assert\Assertion;
use PhpSchool\CliMenu\MenuStyle;
use PhpSchool\CliMenu\Util\StringUtil;
/**
* @author Michael Woodward <[email protected]>
*/
class StaticItem implements MenuItemInterface
{
* @var string
private $text;
public function __construct(string $text)
$this->text = $text;
}
* The output text for the item
public function getRows(MenuStyle $style, bool $selected = false) : array
return explode("\n", StringUtil::wordwrap($this->text, $style->getContentWidth()));
* Can the item be selected
public function canSelect() : bool
return false;
* Execute the items callable if required
public function getSelectAction() : ?callable
return null;
* Return the raw string of text
public function getText() : string
return $this->text;
* Set the raw string of text
public function setText(string $text) : void
* Whether or not the menu item is showing the menustyle extra value
public function showsItemExtra() : bool
* Enable showing item extra
public function showItemExtra() : void
//noop
* Disable showing item extra
public function hideItemExtra() : void