User "MaxSem" posted a comment on MediaWiki.r90127.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90127#c18215
Commit summary:

Replaced static methods to get/set preferences and preference descriptions with 
member functions.

Comment:

<pre>
        public function getScript( ResourceLoaderContext $context ) {
                $moduleName = $this->getName();
-               $gadget = substr( $moduleName, strlen( 'ext.gadget.' ) );
+               $gadgetName = substr( $moduleName, strlen( 'ext.gadget.' ) );
+               $gadgets = Gadget::loadList();
+               $gadget = $gadgets[$gadgetName];
</pre>
Why not pass the gadget to constructor instead?

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to