jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326453 )

Change subject: Add missing type hints to SiteLinksView
......................................................................


Add missing type hints to SiteLinksView

This is very trivial refactoring and cleanup split from Ic54101a.

Change-Id: I56de1e7d3b3549a1f57146a791ca216834c84541
---
M view/src/SiteLinksView.php
1 file changed, 17 insertions(+), 12 deletions(-)

Approvals:
  Hoo man: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/view/src/SiteLinksView.php b/view/src/SiteLinksView.php
index 26b0e73..33cd322 100644
--- a/view/src/SiteLinksView.php
+++ b/view/src/SiteLinksView.php
@@ -110,7 +110,7 @@
         * @param ItemId|null $itemId The id of the item or might be null, if a 
new item.
         * @param string[] $groups An array of site group IDs
         *
-        * @return string
+        * @return string HTML
         */
        public function getHtml( array $siteLinks, ItemId $itemId = null, array 
$groups ) {
                $html = '';
@@ -137,7 +137,7 @@
         *
         * @param string $heading message key of the heading; also used as css 
class
         *
-        * @return string
+        * @return string HTML
         */
        private function getHtmlForSectionHeading( $heading ) {
                $html = $this->templateFactory->render(
@@ -157,7 +157,7 @@
         * @param ItemId|null $itemId The id of the item
         * @param string $group a site group ID
         *
-        * @return string
+        * @return string HTML
         */
        private function getHtmlForSiteLinkGroup( array $siteLinks, ItemId 
$itemId = null, $group ) {
                $siteLinksForTable = $this->getSiteLinksForTable(
@@ -265,7 +265,7 @@
         * @param array[] $siteLinksForTable
         * @param bool $isSpecialGroup
         *
-        * @return string
+        * @return string HTML
         */
        private function getHtmlForSiteLinks( array $siteLinksForTable, 
$isSpecialGroup ) {
                $html = '';
@@ -281,7 +281,7 @@
         * @param array $siteLinkForTable
         * @param bool $isSpecialGroup
         *
-        * @return string
+        * @return string HTML
         */
        private function getHtmlForSiteLink( array $siteLinkForTable, 
$isSpecialGroup ) {
                /** @var Site $site */
@@ -324,15 +324,15 @@
         * @param SiteLink $siteLink
         * @param Site $site
         *
-        * @return string
+        * @return string HTML
         */
-       private function getHtmlForPage( $siteLink, $site ) {
+       private function getHtmlForPage( SiteLink $siteLink, Site $site ) {
                $pageName = $siteLink->getPageName();
 
                return $this->templateFactory->render( 
'wikibase-sitelinkview-pagename',
                        htmlspecialchars( $site->getPageUrl( $pageName ) ),
                        htmlspecialchars( $pageName ),
-                       $this->getHtmlForBadges( $siteLink ),
+                       $this->getHtmlForBadges( $siteLink->getBadges() ),
                        $site->getLanguageCode(),
                        'auto'
                );
@@ -341,9 +341,9 @@
        /**
         * @param SiteLink $siteLink
         *
-        * @return string
+        * @return string HTML
         */
-       private function getHtmlForUnknownSiteLink( $siteLink ) {
+       private function getHtmlForUnknownSiteLink( SiteLink $siteLink ) {
                // FIXME: No need for separate template; Use 
'wikibase-sitelinkview' template.
                return $this->templateFactory->render( 
'wikibase-sitelinkview-unknown',
                        htmlspecialchars( $siteLink->getSiteId() ),
@@ -351,10 +351,15 @@
                );
        }
 
-       private function getHtmlForBadges( SiteLink $siteLink ) {
+       /**
+        * @param ItemId[] $badges
+        *
+        * @return string HTML
+        */
+       private function getHtmlForBadges( array $badges ) {
                $html = '';
 
-               foreach ( $siteLink->getBadges() as $badge ) {
+               foreach ( $badges as $badge ) {
                        $serialization = $badge->getSerialization();
                        $classes = Sanitizer::escapeClass( $serialization );
                        if ( !empty( $this->badgeItems[$serialization] ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/326453
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I56de1e7d3b3549a1f57146a791ca216834c84541
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to