This is the entry file and is in the global scope, so the above "global $wgExtensionCredits;" is not needed (also lots of the other calls to global are not needed here.)
Of course these would be needed if you used call_user_func() like we do at https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/client/WikibaseClient.php#L45