File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ private function extractLabels($prTitle)
78
78
);
79
79
80
80
foreach ($ matches ['labels ' ] as $ label ) {
81
+ $ label = $ this ->fixLabelName ($ label );
82
+
81
83
// check case-insensitively, but the apply the correctly-cased label
82
84
if (isset ($ validLabels [strtolower ($ label )])) {
83
85
$ labels [] = $ validLabels [strtolower ($ label )];
@@ -109,6 +111,27 @@ private function getValidLabels()
109
111
);
110
112
}
111
113
114
+ /**
115
+ * It fixes common misspellings and aliases commonly used for label names
116
+ * (e.g. DI -> DependencyInjection).
117
+ */
118
+ private function fixLabelName ($ label )
119
+ {
120
+ $ labelAliases = array (
121
+ 'di ' => 'DependencyInjection ' ,
122
+ 'bridge\twig ' => 'TwigBridge ' ,
123
+ 'router ' => 'Routing ' ,
124
+ 'translation ' => 'Translator ' ,
125
+ 'twig bridge ' => 'TwigBridge ' ,
126
+ );
127
+
128
+ if (in_array (strtolower ($ label ), $ labelAliases )) {
129
+ return $ labelAliases [strtolower ($ label )];
130
+ }
131
+
132
+ return $ label ;
133
+ }
134
+
112
135
public static function getSubscribedEvents ()
113
136
{
114
137
return array (
You can’t perform that action at this time.
0 commit comments