Skip to content

Commit 1480be0

Browse files
authored
Sync hello-world (#909)
1 parent d298bdf commit 1480be0

File tree

4 files changed

+13
-28
lines changed

4 files changed

+13
-28
lines changed

bin/auto-sync.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ flower-field
2828
food-chain
2929
grade-school
3030
hamming
31+
hello-world
3132
house
3233
isbn-verifier
3334
isogram
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Instructions
22

3-
The classical introductory exercise. Just say "Hello, World!".
3+
The classical introductory exercise.
4+
Just say "Hello, World!".
45

5-
["Hello, World!"](https://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is
6-
the traditional first program for beginning programming in a new language
7-
or environment.
6+
["Hello, World!"][hello-world] is the traditional first program for beginning programming in a new language or environment.
87

98
The objectives are simple:
109

11-
- Write a function that returns the string "Hello, World!".
10+
- Modify the provided code so that it produces the string "Hello, World!".
1211
- Run the test suite and make sure that it succeeds.
1312
- Submit your solution and check it at the website.
1413

1514
If everything goes well, you will be ready to fetch your first real exercise.
15+
16+
[hello-world]: https://en.wikipedia.org/wiki/%22Hello,_world!%22_program

exercises/practice/hello-world/.meta/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
".meta/example.php"
2020
]
2121
},
22-
"blurb": "The classical introductory exercise. Just say \"Hello, World!\"",
22+
"blurb": "Exercism's classic introductory exercise. Just say \"Hello, World!\".",
2323
"source": "This is an exercise to introduce users to using Exercism",
2424
"source_url": "https://en.wikipedia.org/wiki/%22Hello,_world!%22_program"
2525
}

exercises/practice/hello-world/HelloWorldTest.php

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,9 @@
11
<?php
22

3-
/*
4-
* By adding type hints and enabling strict type checking, code can become
5-
* easier to read, self-documenting and reduce the number of potential bugs.
6-
* By default, type declarations are non-strict, which means they will attempt
7-
* to change the original type to match the type specified by the
8-
* type-declaration.
9-
*
10-
* In other words, if you pass a string to a function requiring a float,
11-
* it will attempt to convert the string value to a float.
12-
*
13-
* To enable strict mode, a single declare directive must be placed at the top
14-
* of the file.
15-
* This means that the strictness of typing is configured on a per-file basis.
16-
* This directive not only affects the type declarations of parameters, but also
17-
* a function's return type.
18-
*
19-
* For more info review the Concept on strict type checking in the PHP track
20-
* <link>.
21-
*
22-
* To disable strict typing, comment out the directive below.
23-
*/
24-
253
declare(strict_types=1);
264

275
use PHPUnit\Framework\TestCase;
6+
use PHPUnit\Framework\Attributes\TestDox;
287

298
class HelloWorldTest extends TestCase
309
{
@@ -33,6 +12,10 @@ public static function setUpBeforeClass(): void
3312
require_once 'HelloWorld.php';
3413
}
3514

15+
/**
16+
* uuid: af9ffe10-dc13-42d8-a742-e7bdafac449d
17+
*/
18+
#[TestDox('Say Hi!')]
3619
public function testHelloWorld(): void
3720
{
3821
$this->assertEquals('Hello, World!', helloWorld());

0 commit comments

Comments
 (0)