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)
7878 );
7979
8080 foreach ($ matches ['labels ' ] as $ label ) {
81+ $ label = $ this ->fixLabelName ($ label );
82+
8183 // check case-insensitively, but the apply the correctly-cased label
8284 if (isset ($ validLabels [strtolower ($ label )])) {
8385 $ labels [] = $ validLabels [strtolower ($ label )];
@@ -109,6 +111,27 @@ private function getValidLabels()
109111 );
110112 }
111113
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+
112135 public static function getSubscribedEvents ()
113136 {
114137 return array (
You can’t perform that action at this time.
0 commit comments