From 5c4abfe4b6e6a93d29651516dea60dadb8a8fedd Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Mon, 25 May 2026 20:13:09 +0100 Subject: [PATCH 1/5] sync files --- .../practice/rail-fence-cipher/.docs/instructions.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/exercises/practice/rail-fence-cipher/.docs/instructions.md b/exercises/practice/rail-fence-cipher/.docs/instructions.md index 0e75a2bf7..e311de6cd 100644 --- a/exercises/practice/rail-fence-cipher/.docs/instructions.md +++ b/exercises/practice/rail-fence-cipher/.docs/instructions.md @@ -2,15 +2,13 @@ Implement encoding and decoding for the rail fence cipher. -The Rail Fence cipher is a form of transposition cipher that gets its name from -the way in which it's encoded. It was already used by the ancient Greeks. +The Rail Fence cipher is a form of transposition cipher that gets its name from the way in which it's encoded. +It was already used by the ancient Greeks. -In the Rail Fence cipher, the message is written downwards on successive "rails" -of an imaginary fence, then moving up when we get to the bottom (like a zig-zag). +In the Rail Fence cipher, the message is written downwards on successive "rails" of an imaginary fence, then moving up when we get to the bottom (like a zig-zag). Finally the message is then read off in rows. -For example, using three "rails" and the message "WE ARE DISCOVERED FLEE AT ONCE", -the cipherer writes out: +For example, using three "rails" and the message "WE ARE DISCOVERED FLEE AT ONCE", the cipherer writes out: ```text W . . . E . . . C . . . R . . . L . . . T . . . E From a511bfc5df90302e36cce063527c5db06d40b047 Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Mon, 25 May 2026 20:14:53 +0100 Subject: [PATCH 2/5] remove strict comments from test file and example file --- .../rail-fence-cipher/.meta/example.php | 22 ------------------- .../rail-fence-cipher/RailFenceCipherTest.php | 22 ------------------- 2 files changed, 44 deletions(-) diff --git a/exercises/practice/rail-fence-cipher/.meta/example.php b/exercises/practice/rail-fence-cipher/.meta/example.php index 6d15f309c..59b31b8c3 100644 --- a/exercises/practice/rail-fence-cipher/.meta/example.php +++ b/exercises/practice/rail-fence-cipher/.meta/example.php @@ -1,27 +1,5 @@ . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); function encode($plainMessage, $rails) diff --git a/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php b/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php index 3e808a2e6..299aa4733 100644 --- a/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php +++ b/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php @@ -1,27 +1,5 @@ . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); use PHPUnit\Framework\TestCase; From 94264e4f9643ff101e617b93927c26c6ed74e047 Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Mon, 25 May 2026 21:20:14 +0100 Subject: [PATCH 3/5] sync tests file uuid and description with test file --- .../rail-fence-cipher/RailFenceCipherTest.php | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php b/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php index 299aa4733..8cacfe91d 100644 --- a/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php +++ b/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php @@ -3,6 +3,7 @@ declare(strict_types=1); use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\TestDox; class RailFenceCipherTest extends TestCase { @@ -12,8 +13,9 @@ public static function setUpBeforeClass(): void } /** - * Test encode with two rails. + * uuid 46dc5c50-5538-401d-93a5-41102680d068 */ + #[TestDox('encode with two rails')] public function testEncodeWithTwoRails(): void { $plainText = "XOXOXOXOXOXOXOXOXO"; @@ -21,9 +23,11 @@ public function testEncodeWithTwoRails(): void $expected = "XXXXXXXXXOOOOOOOOO"; $this->assertEquals($expected, encode($plainText, $rails)); } + /** - * Test encode with three rails. + * uuid 25691697-fbd8-4278-8c38-b84068b7bc29 */ + #[TestDox('encode with three rails')] public function testEncodeWithThreeRails(): void { $plainText = "WEAREDISCOVEREDFLEEATONCE"; @@ -33,8 +37,9 @@ public function testEncodeWithThreeRails(): void } /** - * Test encode with ending in the middle. + * uuid 384f0fea-1442-4f1a-a7c4-5cbc2044002c */ + #[TestDox('encode with ending in the middle')] public function testEncodeWithEndingInTheMiddle(): void { $plainText = "EXERCISES"; @@ -44,8 +49,9 @@ public function testEncodeWithEndingInTheMiddle(): void } /** - * Test decode with three rails. + * uuid cd525b17-ec34-45ef-8f0e-4f27c24a7127 */ + #[TestDox('decode with three rails')] public function testDecodeWithThreeRails(): void { $encryptedText = "TEITELHDVLSNHDTISEIIEA"; @@ -53,9 +59,11 @@ public function testDecodeWithThreeRails(): void $expected = "THEDEVILISINTHEDETAILS"; $this->assertEquals($expected, decode($encryptedText, $rails)); } + /** - * Test decode with five rails. + * uuid dd7b4a98-1a52-4e5c-9499-cbb117833507 */ + #[TestDox('decode with five rails')] public function testDecodeWithFiveRails(): void { $encryptedText = "EIEXMSMESAORIWSCE"; @@ -65,8 +73,9 @@ public function testDecodeWithFiveRails(): void } /** - * Test decode with six rails. + * uuid 93e1ecf4-fac9-45d9-9cd2-591f47d3b8d3 */ + #[TestDox('decode with six rails')] public function testDecodeWithSixRails(): void { $encryptedText = "133714114238148966225439541018335470986172518171757571896261"; From 153f26fa8ce24763e6fb12c546b67d48990700b3 Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Mon, 25 May 2026 21:23:42 +0100 Subject: [PATCH 4/5] add exercise to auto-sync.txt and name to config.json --- bin/auto-sync.txt | 1 + exercises/practice/rail-fence-cipher/.meta/config.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/auto-sync.txt b/bin/auto-sync.txt index e74773c2c..262964b06 100644 --- a/bin/auto-sync.txt +++ b/bin/auto-sync.txt @@ -62,6 +62,7 @@ pig-latin protein-translation proverb queen-attack +rail-fence-cipher raindrops reverse-string rna-transcription diff --git a/exercises/practice/rail-fence-cipher/.meta/config.json b/exercises/practice/rail-fence-cipher/.meta/config.json index 6546e2eee..8ecc83053 100644 --- a/exercises/practice/rail-fence-cipher/.meta/config.json +++ b/exercises/practice/rail-fence-cipher/.meta/config.json @@ -6,7 +6,8 @@ "arueckauer", "kunicmarko20", "kytrinyx", - "yisraeldov" + "yisraeldov", + "A-O-Emmanuel" ], "files": { "solution": [ From 321701b9536524a89a09d85ff46877610a4ed956 Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Mon, 25 May 2026 21:34:16 +0100 Subject: [PATCH 5/5] fix lint issue with test file --- exercises/practice/rail-fence-cipher/RailFenceCipherTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php b/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php index 8cacfe91d..bea4e33af 100644 --- a/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php +++ b/exercises/practice/rail-fence-cipher/RailFenceCipherTest.php @@ -59,7 +59,7 @@ public function testDecodeWithThreeRails(): void $expected = "THEDEVILISINTHEDETAILS"; $this->assertEquals($expected, decode($encryptedText, $rails)); } - + /** * uuid dd7b4a98-1a52-4e5c-9499-cbb117833507 */