for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpSchool\CliMenu\MenuItem;
/**
* @author Michael Woodward <[email protected]>
*/
class SelectableItem implements MenuItemInterface
{
use SelectableTrait;
* @var callable
private $selectAction;
public function __construct(
string $text,
callable $selectAction,
bool $showItemExtra = false,
bool $disabled = false
) {
$this->text = $text;
$this->selectAction = $selectAction;
$this->showItemExtra = $showItemExtra;
$this->disabled = $disabled;
}
* Execute the items callable if required
public function getSelectAction() : ?callable
return $this->selectAction;
* 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