@@ -16,23 +16,17 @@ final class ChangelogContentsFactory
1616 * @var array<ChangelogCategory::*, string[]>
1717 */
1818 private const FILTER_KEYWORDS_BY_CATEGORY = [
19- ChangelogCategory::SKIPPED => [
20- 'fix wrong reference ' ,
21- 'enable phpstan ' ,
22- 'bump to phpstan ' ,
23- 'bump composer ' ,
24- 'cleanup phpstan ' ,
25- 'compatibility with betterreflection ' ,
26- 'update to ' ,
27- '[automated] ' ,
28- '[core] ' ,
29- '[scope] ' ,
30- '[scoper] ' ,
31- '[scoped] ' ,
32- ],
3319 ChangelogCategory::NEW_FEATURES => ['add ' , 'added ' , 'improve ' ],
3420 ChangelogCategory::BUGFIXES => ['fixed ' , 'fix ' ],
35- ChangelogCategory::REMOVED => ['removed ' , 'deleted ' , 'remove deprecated ' , 'remove ' , 'deprecated ' ],
21+ ChangelogCategory::REMOVED => [
22+ 'removed ' ,
23+ 'deleted ' ,
24+ 'depre ' ,
25+ 'deprecate ' ,
26+ 'remove deprecated ' ,
27+ 'remove ' ,
28+ 'deprecated ' ,
29+ ],
3630 ];
3731
3832 /**
@@ -48,26 +42,21 @@ public function create(array $changelogLines): string
4842 ChangelogCategory::NEW_FEATURES => [],
4943 ChangelogCategory::BUGFIXES => [],
5044 ChangelogCategory::REMOVED => [],
51- ChangelogCategory::SKIPPED => [],
5245 ];
5346
5447 foreach ($ changelogLines as $ changelogLine ) {
5548 foreach (self ::FILTER_KEYWORDS_BY_CATEGORY as $ category => $ filterKeywords ) {
56- if (! $ this ->isKeywordsMatch ($ filterKeywords , $ changelogLine )) {
57- continue ;
58- }
49+ if ($ this ->isKeywordsMatch ($ filterKeywords , $ changelogLine )) {
50+ $ linesByCategory [$ category ][] = $ changelogLine ;
5951
60- $ linesByCategory [ $ category ][] = $ changelogLine ;
61- continue 2 ;
52+ continue 2 ;
53+ }
6254 }
6355
6456 // fallback to fixed
6557 $ linesByCategory [ChangelogCategory::BUGFIXES ][] = $ changelogLine ;
6658 }
6759
68- // remove skipped lines
69- unset($ linesByCategory [ChangelogCategory::SKIPPED ]);
70-
7160 // remove empty categories
7261 $ linesByCategory = array_filter ($ linesByCategory );
7362
0 commit comments