Skip to content

Commit 380e77b

Browse files
committed
create file for first exercise
1 parent c4a1eb9 commit 380e77b

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

app/config.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use PhpSchool\LearnYouPhp\Exercise\TimeServer;
1717
use PhpSchool\LearnYouPhp\Exercise\DependencyHeaven;
1818
use PhpSchool\LearnYouPhp\TcpSocketFactory;
19+
use PhpSchool\PhpWorkshop\Event\Event;
1920
use Symfony\Component\Filesystem\Filesystem;
2021
use Faker\Factory as FakerFactory;
2122

@@ -51,5 +52,15 @@
5152
}),
5253
DependencyHeaven::class => factory(function (ContainerInterface $c) {
5354
return new DependencyHeaven(FakerFactory::create('fr_FR'));
54-
})
55+
}),
56+
57+
'eventListeners' => [
58+
'exercise.selected.hello-world' => [
59+
function () {
60+
if (!file_exists('hello-world.php')) {
61+
touch('hello-world.php');
62+
}
63+
}
64+
]
65+
]
5566
];

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"require" : {
1515
"php" : ">=5.6",
1616
"ext-pdo_sqlite": "*",
17-
"php-school/php-workshop": "^1.1",
17+
"php-school/php-workshop": "dev-exercise-selected-event",
1818
"hoa/socket": "^1.0",
1919
"php-school/workshop-installer": "^0.1"
2020
},

composer.lock

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

exercises/hello-world/problem/problem.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ You should see the word "text" printed out on the console.
3535

3636
Now you must adapt the code to pass the challenge presented. Remember the challenge was: Write a program that prints the text "Hello World" to the console (stdout).
3737

38+
We have created you a file named `hello-world.php` in your current working directory, feel free to use it!
3839

3940
When you have finished and saved the file you must run the following (substituting program.php to the name of the file you created which contains your code)
4041

0 commit comments

Comments
 (0)