Several Wikibase codebases use class_exists checks in tests as well as productive code to check if a specific extension is enabled:
```lang=php, counterexample
if ( !class_exists( 'CheckUser' ) ) {
```
This binds against a full qualified class name in a super-problematic way that does not fail when the class is renamed or moved to an other namespace. This already caused many regressions in other (related and unrelated) codebases.
All these conditionals must be replaced with a proper check :
```lang=php
if ( !ExtensionRegistry::getInstance()->isLoaded( 'CheckUser' ) ) {
```
See https://gerrit.wikimedia.org/r/398511 for an example.
[] EchoEvent (18)
[] BetaFeatures (15)
[] CirrusSearch (15)
[] CentralAuthUser (7)
[] CentralAuthSpoofUser (6)
[] EventLogging (6)
[] LqtDispatch (6)
[] GeoData (5)
[] ResourceLoaderSchemaModule (4)
[] SiteMatrix (4)
[] AbuseFilter (3)
[] AntiSpoofAuthenticationRequest (3)
[] CommentStore (3)
[] GuidedTourHooks (3)
[] RenameuserSQL (3)
[] ThanksHooks (3)
[] WikiEditorHooks (3)
[] ApiUsageException (2)
[] AuthManager (2)
[] Babel (2)
[] EchoHooks (2)
[] GlobalBlocking (2)
[] Imagick (2)
[] MobileContext (2)
[] PageImages (2)
[] PageProps (2)
[] PHPUnit_Framework_TestCase (2)
[] Scribunto_LuaEngineTestBase (2)
[] tidy (2)
[] TitleBlacklist (2)
[] VisualEditorHooks (2)
[] WikibaseClient (2)
[] XMLReader (2)