In T308718 I am introducing a pattern in which MediaWiki\ResourceLoader is imported as the alias RL, so that short and ambiguous class names like ResourceLoaderContext can have their prefix stripped, becoming RL\Context at some call sites. The abbreviation RL is always used instead of ResourceLoader to avoid conflicting with the class of that name.
A few extensions have MediaWiki.Classes.FullQualifiedClassName enabled, and this sniff fails with RL\Context and similar references. See VisualEditor 793616 for example. But I think it is within the spirit of the rule to allow such an alias.
- Replace it with a metric that measures the number of components in a class name reference, and limit it to 2. So the existing exception examples \Title and \Wikimedia\suppressWarnings() would continue to be allowed on the basis that they have 1 and 2 components, and RL\Context would because it has two components, whereas MediaWiki\ResourceLoader\Context would not be allowed because it has 3 components. Although this would allow MediaWiki\MediaWikiServices which is not intended.
- Parse alias declarations, and allow the aliases which were seen in the file.