Thiemo Mättig (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/188361

Change subject: Inline trivial ItemSearchTextGenerator code
......................................................................

Inline trivial ItemSearchTextGenerator code

My reason to touch this code was an "unknown method called" warning
by PHPStorm's code analysis. It's gone with this refactoring.

Change-Id: Id2d7a4568d8a1c93ce69e04ab5dc2476d3783e30
---
M repo/includes/ItemSearchTextGenerator.php
1 file changed, 3 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/61/188361/1

diff --git a/repo/includes/ItemSearchTextGenerator.php 
b/repo/includes/ItemSearchTextGenerator.php
index e948ee6..ab90311 100644
--- a/repo/includes/ItemSearchTextGenerator.php
+++ b/repo/includes/ItemSearchTextGenerator.php
@@ -21,25 +21,11 @@
                $entitySearchTextGenerator = new EntitySearchTextGenerator();
                $text = $entitySearchTextGenerator->generate( $item );
 
-               $siteLinks = $item->getSiteLinks();
-               $text .= $this->getSiteLinksText( $siteLinks );
-
-               return $text;
-       }
-
-       /**
-        * @param array $siteLinks
-        *
-        * @return string
-        */
-       protected function getSiteLinksText( array $siteLinks ) {
-               $pages = array();
-
-               foreach( $siteLinks as $siteLink ) {
-                       $pages[] = $siteLink->getPageName();
+               foreach ( $item->getSiteLinks() as $siteLink ) {
+                       $text .= "\n" . $siteLink->getPageName();
                }
 
-               return "\n" . implode( "\n", $pages );
+               return trim( $text );
        }
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2d7a4568d8a1c93ce69e04ab5dc2476d3783e30
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

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

Reply via email to