/**
* @internal
*/
#[Package('core')]
class ChangelogParser{ public function parse(string
$content): ChangelogDefinition
{ $content =
trim($content);
return (new ChangelogDefinition()) ->
setTitle($this->
parseMetadata($content, 'title'
) ?: ''
) ->
setIssue($this->
parseMetadata($content, 'issue'
) ?: ''
) ->
setFlag($this->
parseMetadata($content, 'flag'
)) ->
setAuthor($this->
parseMetadata($content, 'author'
)) ->
setAuthorEmail($this->
parseMetadata($content, 'author_email'
)) ->
setAuthorGitHub($this->
parseMetadata($content, 'author_github'
)) ->
setCore($this->
parseSection($content, ChangelogSection::core->value
)) ->
setAdministration($this->
parseSection($content, ChangelogSection::administration->value
)) ->
setStorefront($this->
parseSection($content, ChangelogSection::storefront->value
)) ->
setApi($this->
parseSection($content, ChangelogSection::api->value
)) ->
setUpgradeInformation($this->
parseSection($content, ChangelogSection::upgrade->value
))