Skip to content

Commit 68a8d95

Browse files
committed
Updating PHPDoc.
1 parent b0e489b commit 68a8d95

File tree

14 files changed

+48
-39
lines changed

14 files changed

+48
-39
lines changed

src/Puzzle.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44

55
namespace CyrilVerloop\Codingame;
66

7+
/**
8+
* A base class for puzzle.
9+
*/
710
abstract class Puzzle
811
{
912
// Methods :
1013

14+
/**
15+
* Execute the code of the puzzle.
16+
* @param resource $stdin the resource to get the datas from.
17+
*/
1118
abstract public function execute($stdin): void;
1219
}

src/Training/Easy/ASCIIArt/ASCIIArt.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use CyrilVerloop\Codingame\Puzzle;
88

9+
/**
10+
* The "ASCII Art" puzzle.
11+
*/
912
class ASCIIArt extends Puzzle
1013
{
1114
// Methods :

src/Training/Easy/Defibrillators/Defibrillators.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use CyrilVerloop\Codingame\Puzzle;
88

9+
/**
10+
* The "Defibrillators" puzzle.
11+
*/
912
class Defibrillators extends Puzzle
1013
{
1114
// Methods :

src/Training/Easy/HorseRacingDuals/HorseRacingDuals.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use CyrilVerloop\Codingame\Puzzle;
88

9+
/**
10+
* The "Horse-racing Duals" puzzle.
11+
*/
912
class HorseRacingDuals extends Puzzle
1013
{
1114
// Methods :

src/Training/Easy/MIMEType/MIMEType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use CyrilVerloop\Codingame\Puzzle;
88

9+
/**
10+
* The "MIME Type" puzzle.
11+
*/
912
class MIMEType extends Puzzle
1013
{
1114
// Methods :

src/Training/Easy/Temperatures/Temperatures.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use CyrilVerloop\Codingame\Puzzle;
88

9+
/**
10+
* The "Temperatures" puzzle.
11+
*/
912
class Temperatures extends Puzzle
1013
{
1114
// Methods :

src/Training/Easy/Unary/Unary.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use CyrilVerloop\Codingame\Puzzle;
88

9+
/**
10+
* The "Unary" puzzle.
11+
*/
912
class Unary extends Puzzle
1013
{
1114
// Methods :

tests/PuzzleTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
use PHPUnit\Framework\TestCase;
88

99
/**
10-
* @coversDefaultClass \CyrilVerloop\Codingame\Training\Easy\HorseRacingDuals\HorseRacingDuals
10+
* Base class for testing puzzles.
1111
*/
1212
abstract class PuzzleTest extends TestCase
1313
{
1414
// Properties :
1515

16-
/**
17-
* @var \CyrilVerloop\Codingame\Puzzle the puzzle.
18-
*/
16+
/** @var \CyrilVerloop\Codingame\Puzzle the puzzle. */
1917
protected $puzzle;
2018

2119

2220
// Methods :
2321

2422
/**
25-
* Expects execute to output answer.
23+
* Expects `execute()` to output answer.
24+
* @param string $filename the file name.
25+
* @param string $expectedAnswer the expected answer.
2626
*/
2727
protected function expectExecuteOutputAnswer(string $filename, string $expectedAnswer): void
2828
{

tests/Training/Easy/ASCIIArt/ASCIIArtTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
use CyrilVerloop\Codingame\Training\Easy\ASCIIArt\ASCIIArt;
99

1010
/**
11-
* @coversDefaultClass \CyrilVerloop\Codingame\Training\Easy\ASCIIArt\ASCIIArt
11+
* Tests for the "ASCII Art" puzzle.
12+
*
13+
* @covers \CyrilVerloop\Codingame\Training\Easy\ASCIIArt\ASCIIArt
1214
* @group ASCIIArt
1315
*/
1416
final class ASCIIArtTest extends PuzzleTest
@@ -26,7 +28,6 @@ public function setUp(): void
2628
/**
2729
* Test that the code can be executed for "Test only one letter: E".
2830
*
29-
* @covers ::execute
3031
* @group ASCIIArt_onlyOneLetterE
3132
*/
3233
public function testCanExecuteTestOnlyOneLetterE(): void
@@ -40,7 +41,6 @@ public function testCanExecuteTestOnlyOneLetterE(): void
4041
/**
4142
* Test that the code can be executed for "Test MANHATTAN".
4243
*
43-
* @covers ::execute
4444
* @group ASCIIArt_testMANHATTAN
4545
*/
4646
public function testCanExecuteTestMANHATTAN(): void
@@ -54,7 +54,6 @@ public function testCanExecuteTestMANHATTAN(): void
5454
/**
5555
* Test that the code can be executed for "Test ManhAtTan".
5656
*
57-
* @covers ::execute
5857
* @group ASCIIArt_testManhAtTan
5958
*/
6059
public function testCanExecuteTestDifferentCaseManhAtTan(): void
@@ -68,7 +67,6 @@ public function testCanExecuteTestDifferentCaseManhAtTan(): void
6867
/**
6968
* Test that the code can be executed for "Test M@NH@TT@N".
7069
*
71-
* @covers ::execute
7270
* @group ASCIIArt_testM@NH@TT@N
7371
*/
7472
public function testCanExecuteTestMatNHatTTatN(): void
@@ -82,7 +80,6 @@ public function testCanExecuteTestMatNHatTTatN(): void
8280
/**
8381
* Test that the code can be executed for "MANHATTAN with another ASCII representation".
8482
*
85-
* @covers ::execute
8683
* @group ASCIIArt_MANHATTANWithAnotherASCIIRepresentation
8784
*/
8885
public function testCanExecuteMANHATTANWithAnotherASCIIRepresentation(): void
@@ -96,7 +93,6 @@ public function testCanExecuteMANHATTANWithAnotherASCIIRepresentation(): void
9693
/**
9794
* Test that the code can be executed for "Test MAN HAT TAN".
9895
*
99-
* @covers ::execute
10096
* @group ASCIIArt_TestMAN_HAT_TAN
10197
*/
10298
public function testCanExecuteTestMAN_HAT_TAN(): void

tests/Training/Easy/Defibrillators/DefibrillatorsTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
use CyrilVerloop\Codingame\Training\Easy\Defibrillators\Defibrillators;
99

1010
/**
11-
* @coversDefaultClass \CyrilVerloop\Codingame\Training\Easy\Defibrillators\Defibrillators
11+
* Tests for the "Defibrillators" puzzle.
12+
*
13+
* @covers \CyrilVerloop\Codingame\Training\Easy\Defibrillators\Defibrillators
1214
* @group defibrillators
1315
*/
1416
final class DefibrillatorsTest extends PuzzleTest
@@ -26,7 +28,6 @@ public function setUp(): void
2628
/**
2729
* Test that the code can be executed for "Example".
2830
*
29-
* @covers ::execute
3031
* @group defibrillators_example
3132
*/
3233
public function testCanExecuteExample(): void
@@ -40,7 +41,6 @@ public function testCanExecuteExample(): void
4041
/**
4142
* Test that the code can be executed for "Exact position".
4243
*
43-
* @covers ::execute
4444
* @group defibrillators_exactPosition
4545
*/
4646
public function testCanExecuteExactPosition(): void
@@ -54,7 +54,6 @@ public function testCanExecuteExactPosition(): void
5454
/**
5555
* Test that the code can be executed for "Complete file".
5656
*
57-
* @covers ::execute
5857
* @group defibrillators_completeFile
5958
*/
6059
public function testCanExecuteCompleteFile(): void
@@ -68,7 +67,6 @@ public function testCanExecuteCompleteFile(): void
6867
/**
6968
* Test that the code can be executed for "Complete file 2".
7069
*
71-
* @covers ::execute
7270
* @group defibrillators_completeFile2
7371
*/
7472
public function testCanExecuteCompleteFile2(): void

tests/Training/Easy/HorseRacingDuals/HorseRacingDualsTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
use CyrilVerloop\Codingame\Training\Easy\HorseRacingDuals\HorseRacingDuals;
99

1010
/**
11-
* @coversDefaultClass \CyrilVerloop\Codingame\Training\Easy\HorseRacingDuals\HorseRacingDuals
11+
* Tests for the "Horse-racing Duals" puzzle.
12+
*
13+
* @covers \CyrilVerloop\Codingame\Training\Easy\HorseRacingDuals\HorseRacingDuals
1214
* @group horseRacingDuals
1315
*/
1416
final class HorseRacingDualsTest extends PuzzleTest
@@ -26,7 +28,6 @@ public function setUp(): void
2628
/**
2729
* Test that the code can be executed for "Simple case".
2830
*
29-
* @covers ::execute
3031
* @group horseRacingDuals_simpleCase
3132
*/
3233
public function testCanExecuteSimpleCase(): void
@@ -40,7 +41,6 @@ public function testCanExecuteSimpleCase(): void
4041
/**
4142
* Test that the code can be executed for "Horses in any order".
4243
*
43-
* @covers ::execute
4444
* @group horseRacingDuals_horsesInAnyOrder
4545
*/
4646
public function testCanExecuteHorsesInAnyOrder(): void
@@ -54,7 +54,6 @@ public function testCanExecuteHorsesInAnyOrder(): void
5454
/**
5555
* Test that the code can be executed for "Many horses".
5656
*
57-
* @covers ::execute
5857
* @group horseRacingDuals_manyHorses
5958
*/
6059
public function testCanExecuteManyHorses(): void

tests/Training/Easy/MIMEType/MIMETypeTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
use CyrilVerloop\Codingame\Training\Easy\MIMEType\MIMEType;
99

1010
/**
11-
* @coversDefaultClass \CyrilVerloop\Codingame\Training\Easy\MIMEType\MIMEType
11+
* Tests for the "MIME Type" puzzle.
12+
*
13+
* @covers \CyrilVerloop\Codingame\Training\Easy\MIMEType\MIMEType
1214
* @group MIMEType
1315
*/
1416
final class MIMETypeTest extends PuzzleTest
@@ -26,7 +28,6 @@ public function setUp(): void
2628
/**
2729
* Test that the code can be executed for "Simple example".
2830
*
29-
* @covers ::execute
3031
* @group MIMEType_simpleExample
3132
*/
3233
public function testCanExecuteSimpleExample(): void
@@ -40,7 +41,6 @@ public function testCanExecuteSimpleExample(): void
4041
/**
4142
* Test that the code can be executed for "Unknown MIME types".
4243
*
43-
* @covers ::execute
4444
* @group MIMEType_unknownMIMETypes
4545
*/
4646
public function testCanExecuteUnknownMIMETypes(): void
@@ -54,7 +54,6 @@ public function testCanExecuteUnknownMIMETypes(): void
5454
/**
5555
* Test that the code can be executed for "Correct division of the extension".
5656
*
57-
* @covers ::execute
5857
* @group MIMEType_correctDivisionOfTheExtension
5958
*/
6059
public function testCanExecuteCorrectDivisionOfTheExtension(): void
@@ -68,7 +67,6 @@ public function testCanExecuteCorrectDivisionOfTheExtension(): void
6867
/**
6968
* Test that the code can be executed for "Consideration of the case (upper or lower)".
7069
*
71-
* @covers ::execute
7270
* @group MIMEType_considerationOfTheCase
7371
*/
7472
public function testCanExecuteConsiderationOfTheCase(): void
@@ -82,7 +80,6 @@ public function testCanExecuteConsiderationOfTheCase(): void
8280
/**
8381
* Test that the code can be executed for "Large dataset".
8482
*
85-
* @covers ::execute
8683
* @group MIMEType_largeDataset
8784
*/
8885
public function testCanExecuteLargeDataset(): void

tests/Training/Easy/Temperatures/TemperaturesTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
use CyrilVerloop\Codingame\Training\Easy\Temperatures\Temperatures;
99

1010
/**
11-
* @coversDefaultClass \CyrilVerloop\Codingame\Training\Easy\Temperatures\Temperatures
11+
* Tests for the "Temperatures" puzzle.
12+
*
13+
* @covers \CyrilVerloop\Codingame\Training\Easy\Temperatures\Temperatures
1214
* @group temperatures
1315
*/
1416
final class TemperaturesTest extends PuzzleTest
@@ -26,7 +28,6 @@ public function setUp(): void
2628
/**
2729
* Test that the code can be executed for "Simple test case".
2830
*
29-
* @covers ::execute
3031
* @group unary_simpleTestCase
3132
*/
3233
public function testCanExecuteSimpleTestCase(): void
@@ -40,7 +41,6 @@ public function testCanExecuteSimpleTestCase(): void
4041
/**
4142
* Test that the code can be executed for "Only negative numbers".
4243
*
43-
* @covers ::execute
4444
* @group unary_onlyNegativeNumbers
4545
*/
4646
public function testCanExecuteOnlyNegativeNumbers(): void
@@ -54,7 +54,6 @@ public function testCanExecuteOnlyNegativeNumbers(): void
5454
/**
5555
* Test that the code can be executed for "Choose the right temperature".
5656
*
57-
* @covers ::execute
5857
* @group unary_chooseTheRightTemperature
5958
*/
6059
public function testCanExecuteChooseTheRightTemperature(): void
@@ -68,7 +67,6 @@ public function testCanExecuteChooseTheRightTemperature(): void
6867
/**
6968
* Test that the code can be executed for "Choose the right temperature 2".
7069
*
71-
* @covers ::execute
7270
* @group unary_chooseTheRightTemperature2
7371
*/
7472
public function testCanExecuteChooseTheRightTemperature2(): void
@@ -82,7 +80,6 @@ public function testCanExecuteChooseTheRightTemperature2(): void
8280
/**
8381
* Test that the code can be executed for "Complex test case".
8482
*
85-
* @covers ::execute
8683
* @group unary_complexTestCase
8784
*/
8885
public function testCanExecuteComplexTestCase(): void
@@ -96,7 +93,6 @@ public function testCanExecuteComplexTestCase(): void
9693
/**
9794
* Test that the code can be executed for "No temperature".
9895
*
99-
* @covers ::execute
10096
* @group unary_noTemperature
10197
*/
10298
public function testCanExecuteNoTemperature(): void

tests/Training/Easy/Unary/UnaryTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
use CyrilVerloop\Codingame\Training\Easy\Unary\Unary;
99

1010
/**
11-
* @coversDefaultClass \CyrilVerloop\Codingame\Training\Easy\Unary\Unary
11+
* Tests for the "Unary" puzzle.
12+
*
13+
* @covers \CyrilVerloop\Codingame\Training\Easy\Unary\Unary
1214
* @group unary
1315
*/
1416
final class UnaryTest extends PuzzleTest
@@ -26,7 +28,6 @@ public function setUp(): void
2628
/**
2729
* Test that the code can be executed for "Character C".
2830
*
29-
* @covers ::execute
3031
* @group unary_characterC
3132
*/
3233
public function testCanExecuteCharacterC(): void
@@ -40,7 +41,6 @@ public function testCanExecuteCharacterC(): void
4041
/**
4142
* Test that the code can be executed for "Message CC".
4243
*
43-
* @covers ::execute
4444
* @group unary_messageCC
4545
*/
4646
public function testCanExecuteMessageCC(): void
@@ -54,7 +54,6 @@ public function testCanExecuteMessageCC(): void
5454
/**
5555
* Test that the code can be executed for "Character %".
5656
*
57-
* @covers ::execute
5857
* @group unary_characterPercentSign
5958
*/
6059
public function testCanExecuteCharacterPercentSign(): void
@@ -68,7 +67,6 @@ public function testCanExecuteCharacterPercentSign(): void
6867
/**
6968
* Test that the code can be executed for "Message from Chuck Norris".
7069
*
71-
* @covers ::execute
7270
* @group unary_messageFromChuckNorris
7371
*/
7472
public function testCanExecuteMessageFromChuckNorris(): void

0 commit comments

Comments
 (0)