Skip to content

Commit

Permalink
Merge pull request #34 from PhantPHP/Fix-Company-Fr-CodeActivite
Browse files Browse the repository at this point in the history
Fix : Company Fr CodeActivite
  • Loading branch information
lennyrouanet authored Jun 10, 2024
2 parents 0466855 + 7292e26 commit ae4fdfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions component/Company/Fr/CodeActivite.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public function __construct(string $code)
$code = strtoupper($code);
$code = trim($code);

if (preg_match('/^(\d{4})(\w{1})$/', $code)) {
$code = substr($code, 0, 2) . '.' . substr($code, 2, 5);
}

parent::__construct($code);
}
}
2 changes: 1 addition & 1 deletion test/Company/Fr/CodeActiviteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class CodeActiviteTest extends \PHPUnit\Framework\TestCase
{
public function testInterface(): void
{
$codeActivite = new CodeActivite('62.01Z');
$codeActivite = new CodeActivite('6201Z');

$this->assertEquals('62.01Z', (string)$codeActivite);

Expand Down

0 comments on commit ae4fdfd

Please sign in to comment.