From 91c73f6bac9922925883937fa1279d42c22dd429 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 14 Jun 2020 19:40:02 +0100 Subject: resourceloader: Add some typehints and misc clean up * Add a void return hint to methods that are not meant to return anything. This helps catch accidental return statements in the future, lets Phan better understand how methods are meant to be used, and might also allow PHP to better optimise the compiled code form (speculation). I did not, however, add it to publicly extended methods as that might mess with strict mode. * Remove the internal getResourceLoader() method from MessageBlobStore. This has been redundant since 3edaa0b37c1e2684. The method was protected, and not considered stable to subclass for extensions. Hence not a breaking change. * Add Throwable typehint to formatException() and friends. This is the narrowest one I could add given that the methods called from here already enforce the same typehint. Update the doc to match for now. There isn't a reason right now to limit this only to Exception, and given this is the method and not the catch statement itself, does not change behaviour. * Remove unused ResourceLoader->getHookContainer(). Added within 1.35 cycle, safe to remove. * Remove unexpected `@since` for `@internal` getHookRunner(). * Remove redundant `@internal` from ResourceLoaderMwUrlModule methods, which itself is already `@internal`. Change-Id: I68d33ff6feca7ef95282a7ff03eb9332adfde31c --- includes/resourceloader/ResourceLoaderFileModule.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'includes/resourceloader/ResourceLoaderFileModule.php') diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index 4fe399f4d74a..2dd5eac80bef 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -37,7 +37,6 @@ use MediaWiki\MediaWikiServices; * @since 1.17 */ class ResourceLoaderFileModule extends ResourceLoaderModule { - /** @var string Local base path, see __construct() */ protected $localBasePath = ''; @@ -178,7 +177,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { protected $missingLocalFileRefs = []; /** - * @var VueComponentParser Lazy-created by getVueComponentParser() + * @var VueComponentParser|null Lazy-created by getVueComponentParser() */ protected $vueComponentParser = null; -- cgit v1.2.3