Skip to content

Commit

Permalink
Add XML parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev committed Oct 14, 2023
1 parent 923384b commit 0a37ac2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/CodePoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ public static function ofHtmlEntity(
}

public static function ofXmlEntity(
string $htmlEntity
string $xmlEntity
): self {
return self::ofCharacter(
html_entity_decode(
$htmlEntity,
$xmlEntity,
ENT_XML1 | ENT_QUOTES | ENT_SUBSTITUTE,
),
);
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/CodePointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function testItCannotInstantiateOfXmlEntityWithMoreThanOneCharacter(): vo
{
$this->expectException(\InvalidArgumentException::class);

$xmlEntity = '© ';
$xmlEntity = '™˜';

CodePoint::ofXmlEntity($xmlEntity);
}
Expand Down

0 comments on commit 0a37ac2

Please sign in to comment.