Skip to content

Commit c42bcc9

Browse files
authored
Sync nucleotide-count (#942)
[no important files changed]
1 parent f12f405 commit c42bcc9

File tree

2 files changed

+6
-44
lines changed

2 files changed

+6
-44
lines changed

exercises/practice/nucleotide-count/.meta/example.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
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
function nucleotideCount($dna)

exercises/practice/nucleotide-count/NucleotideCountTest.php

Lines changed: 6 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 NucleotideCountTest extends TestCase
309
{
@@ -36,6 +15,7 @@ public static function setUpBeforeClass(): void
3615
/**
3716
* uuid: 3e5c30a8-87e2-4845-a815-a49671ade970
3817
*/
18+
#[TestDox('Empty DNA sequence')]
3919
public function testEmptyDNASequence(): void
4020
{
4121
$this->assertSame([
@@ -49,6 +29,7 @@ public function testEmptyDNASequence(): void
4929
/**
5030
* uuid: a0ea42a6-06d9-4ac6-828c-7ccaccf98fec
5131
*/
32+
#[TestDox('DNA sequence with single nucleotide')]
5233
public function testDNASequenceSingleNucleotide(): void
5334
{
5435
$this->assertSame([
@@ -62,6 +43,7 @@ public function testDNASequenceSingleNucleotide(): void
6243
/**
6344
* uuid: eca0d565-ed8c-43e7-9033-6cefbf5115b5
6445
*/
46+
#[TestDox('Repetitive DNA sequence')]
6547
public function testRepetitiveDNASequence(): void
6648
{
6749
$this->assertSame([
@@ -75,6 +57,7 @@ public function testRepetitiveDNASequence(): void
7557
/**
7658
* uuid: 40a45eac-c83f-4740-901a-20b22d15a39f
7759
*/
60+
#[TestDox('DNA sequence with multiple nucleotides')]
7861
public function testDNASequenceWithMultipleNucleotides(): void
7962
{
8063
$this->assertSame([
@@ -88,6 +71,7 @@ public function testDNASequenceWithMultipleNucleotides(): void
8871
/**
8972
* uuid: b4c47851-ee9e-4b0a-be70-a86e343bd851
9073
*/
74+
#[TestDox('DNA sequence with invalid nucleotides')]
9175
public function testDNASequenceWithInvalidNucleotides(): void
9276
{
9377
$this->expectException(Exception::class);

0 commit comments

Comments
 (0)