Skip to content

Commit d0f22bd

Browse files
committed
first project/second step/ added Cli.php
1 parent 14cacfc commit d0f22bd

File tree

7 files changed

+107
-21
lines changed

7 files changed

+107
-21
lines changed

.idea/php-project-45.iml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ install:
22
composer install
33

44
brain-games:
5-
.bin/brain-games
5+
bin/brain-games
66

77
validate:
88
composer validate

bin/brain-games

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/usr/bin/env php
2-
3-
<?php
4-
echo "Welcome to the Brain Games!";
1+
#!/usr/bin/env php
2+
3+
<?php
4+
5+
require_once __DIR__ . '/../vendor/autoload.php';
6+
require_once __DIR__ . '/../src/Cli.php';

composer.json

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
{
2-
"name": "hexlet/code",
3-
"description": "study project hexlet",
4-
"type": "project",
5-
"license": "MIT",
6-
"authors": [
7-
{
8-
"name": "Viktor Safonov",
9-
"email": "[email protected]"
10-
}
11-
],
12-
"require": {},
13-
"bin": [
2+
"name": "hexlet/code",
3+
"description": "study project hexlet",
4+
"type": "project",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Viktor Safonov",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {
13+
"wp-cli/php-cli-tools": "^0.12.6"
14+
},
15+
"bin": [
1416
"bin/brain-games"
15-
]
17+
],
18+
"autoload": {
19+
"psr-4": {
20+
"BrainGames\\": "src/"
21+
}
22+
}
1623
}

composer.lock

Lines changed: 66 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cli.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace BrainGames\Cli;
4+
5+
use function cli\line;
6+
use function cli\prompt;
7+
8+
9+
line('Welcome to the Brain Game!');
10+
$name = prompt('May I have your name?');
11+
line("Hello, %s!", $name);

0 commit comments

Comments
 (0)