diff --git a/src/Changelog.php b/src/Changelog.php index c920c77..8f9bdbe 100644 --- a/src/Changelog.php +++ b/src/Changelog.php @@ -222,7 +222,7 @@ public function generate(InputInterface $input, SymfonyStyle $output): int if (in_array($commit->getType(), $types)) { $itemKey = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '', $commit->getDescription())); $type = (string)$commit->getType(); - $scope = (string)$commit->getScope(); + $scope = $commit->getScope()->toPrettyString(); $hash = $commit->getHash(); $changes[$type][$scope][$itemKey][$hash] = [ 'description' => ucfirst($commit->getDescription()), diff --git a/src/Commit/Scope.php b/src/Commit/Scope.php index 574b846..bedbc84 100644 --- a/src/Commit/Scope.php +++ b/src/Commit/Scope.php @@ -17,7 +17,10 @@ public function __construct(string $content) $this->content = $content; } - public function __toString(): string + /** + * Prettify. + */ + public function toPrettyString(): string { $string = ucfirst($this->content); $string = preg_replace('/[_]+/m', ' ', $string); @@ -27,4 +30,9 @@ public function __toString(): string return $string; } + + public function __toString(): string + { + return $this->content; + } }