Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Factory/MenuFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace PhpSchool\PhpWorkshop\Factory;

use PhpSchool\CliMenu\Action\ExitAction;
use PhpSchool\CliMenu\MenuItem\SelectableItem;
use PhpSchool\CliMenu\Style\SelectableStyle;
use PhpSchool\Terminal\Terminal;
use Psr\Container\ContainerInterface;
Expand Down Expand Up @@ -74,7 +76,7 @@ function (CliMenu $menu) use ($exerciseRenderer, $eventDispatcher, $exercise) {
->addLineBreak()
->addItem('HELP', new MenuCommandInvoker($c->get(HelpCommand::class)))
->addItem('CREDITS', new MenuCommandInvoker($c->get(CreditsCommand::class)))
->setExitButtonText('EXIT')
->disableDefaultItems()
->setBackgroundColour($c->get('bgColour'))
->setForegroundColour($c->get('fgColour'))
->setMarginAuto()
Expand Down Expand Up @@ -110,6 +112,14 @@ function (CliMenu $menu) use ($exerciseRenderer, $eventDispatcher, $exercise) {
})
->addLineBreak();

$builder->addMenuItem(new SelectableItem('EXIT', new ExitAction()));

if (PHP_OS_FAMILY === 'Darwin') {
$builder->addLineBreak();
$builder->addItem('www.phpschool.io', function () {
exec('open https://www.phpschool.io');
});
}

if (null !== $c->get('workshopTitle')) {
$builder->setTitle($c->get('workshopTitle'));
Expand Down