Dvogel hallowelt has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404931 )
Change subject: AdminToolRegistry: renamed class AdminToolRegistry to AdminToolFactory ...................................................................... AdminToolRegistry: renamed class AdminToolRegistry to AdminToolFactory and modified function getClasses in IAdminTool: array as return value Change-Id: I089e2d93dbf1fe46f7dc30007c76aee746e3a04b --- M includes/ServiceWiring.php R src/AdminToolFactory.php M src/Hook/SkinTemplateOutputPageBeforeExec/AddAdminTools.php M src/IAdminTool.php M src/Services.php 5 files changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/31/404931/1 diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 397ffa1..14881d3 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -58,8 +58,8 @@ ); }, - 'BSAdminToolRegistry' => function ( MediaWikiServices $services ) { + 'BSAdminToolFactory' => function ( MediaWikiServices $services ) { $attribute = \ExtensionRegistry::getInstance()->getAttribute( 'BlueSpiceFoundationAdminToolRegistry' ); - return new \BlueSpice\AdminToolRegistry( $attribute ); + return new \BlueSpice\AdminToolFactory( $attribute ); } ]; diff --git a/src/AdminToolRegistry.php b/src/AdminToolFactory.php similarity index 94% rename from src/AdminToolRegistry.php rename to src/AdminToolFactory.php index ec48572..b26fc3f 100644 --- a/src/AdminToolRegistry.php +++ b/src/AdminToolFactory.php @@ -2,7 +2,7 @@ namespace BlueSpice; -class AdminToolRegistry { +class AdminToolFactory { protected $classes = []; public function __construct( $classes ) { diff --git a/src/Hook/SkinTemplateOutputPageBeforeExec/AddAdminTools.php b/src/Hook/SkinTemplateOutputPageBeforeExec/AddAdminTools.php index 7969fd8..c34b2b9 100644 --- a/src/Hook/SkinTemplateOutputPageBeforeExec/AddAdminTools.php +++ b/src/Hook/SkinTemplateOutputPageBeforeExec/AddAdminTools.php @@ -7,7 +7,7 @@ class AddAdminTools extends SkinTemplateOutputPageBeforeExec { protected function doProcess() { - $registry = $this->getServices()->getBSAdminToolRegistry(); + $registry = $this->getServices()->getBSAdminToolFactory(); $adminTools = $registry->getAll(); foreach( $adminTools as $toolId => $tool ) { @@ -26,7 +26,7 @@ 'title' => $tool->getDescription(), 'text' => $tool->getName(), 'href' => $tool->getURL(), - 'classes' => $tool->getClasses(), + 'classes' => implode( ' ', $tool->getClasses() ), 'data' => $tool->getDataAttributes(), ]; diff --git a/src/IAdminTool.php b/src/IAdminTool.php index eafd8f7..2e6e815 100644 --- a/src/IAdminTool.php +++ b/src/IAdminTool.php @@ -20,7 +20,7 @@ public function getName(); /** - * @return string + * @return array */ public function getClasses(); diff --git a/src/Services.php b/src/Services.php index f7c3688..096bbdd 100644 --- a/src/Services.php +++ b/src/Services.php @@ -70,9 +70,9 @@ /** * - * @return AdminToolRegistry + * @return AdminToolFactory */ - public function getBSAdminToolRegistry() { - return $this->decoratedServices->getService( 'BSAdminToolRegistry' ); + public function getBSAdminToolFactory() { + return $this->decoratedServices->getService( 'BSAdminToolFactory' ); } } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/404931 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I089e2d93dbf1fe46f7dc30007c76aee746e3a04b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Dvogel hallowelt <daniel.vo...@hallowelt.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits