Skip to content

Commit

Permalink
build: implement greeting and prompt for game
Browse files Browse the repository at this point in the history
  • Loading branch information
kolotov committed Aug 26, 2023
1 parent bdbf0bc commit 7bd1f09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bin/brain-games
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
#!/usr/bin/env php
#!/usr/bin/env docker-compose run php
<?php
require_once './vendor/autoload.php';
require_once './src/Cli.php';
?>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "project",
"autoload": {
"psr-4": {
"App\\": "src/"
"BrainGames\\": "src/"
}
},
"authors": [
Expand Down
8 changes: 8 additions & 0 deletions src/Cli.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
namespace BrainGames\Cli;
use function cli\line;
use function cli\prompt;

line('Welcome to the Brain Game!');
$name = prompt('May I have your name?');
line("Hello, %s!", $name);

0 comments on commit 7bd1f09

Please sign in to comment.