jenkins-bot has submitted this change and it was merged.

Change subject: Minor code clean up in SpecialBooksources
......................................................................


Minor code clean up in SpecialBooksources

Change-Id: Ife378fe87c237123c299ded9a79286abeb8fa34b
---
M includes/specials/SpecialBooksources.php
1 file changed, 7 insertions(+), 8 deletions(-)

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



diff --git a/includes/specials/SpecialBooksources.php 
b/includes/specials/SpecialBooksources.php
index d185203..fe90a4f 100644
--- a/includes/specials/SpecialBooksources.php
+++ b/includes/specials/SpecialBooksources.php
@@ -34,9 +34,6 @@
         */
        private $isbn = '';
 
-       /**
-        * Constructor
-        */
        public function __construct() {
                parent::__construct( 'Booksources' );
        }
@@ -49,9 +46,9 @@
        public function execute( $isbn ) {
                $this->setHeaders();
                $this->outputHeader();
-               $this->isbn = self::cleanIsbn( $isbn ? $isbn : 
$this->getRequest()->getText( 'isbn' ) );
+               $this->isbn = self::cleanIsbn( $isbn ?: 
$this->getRequest()->getText( 'isbn' ) );
                $this->getOutput()->addHTML( $this->makeForm() );
-               if ( strlen( $this->isbn ) > 0 ) {
+               if ( $this->isbn !== '' ) {
                        if ( !self::isValidISBN( $this->isbn ) ) {
                                $this->getOutput()->wrapWikiMsg(
                                        "<div class=\"error\">\n$1\n</div>",
@@ -63,7 +60,8 @@
        }
 
        /**
-        * Returns whether a given ISBN (10 or 13) is valid. True indicates 
validity.
+        * Return whether a given ISBN (10 or 13) is valid.
+        *
         * @param string $isbn ISBN passed for check
         * @return bool
         */
@@ -154,7 +152,7 @@
         * format and output them
         *
         * @throws MWException
-        * @return string
+        * @return bool
         */
        private function showList() {
                global $wgContLang;
@@ -205,7 +203,8 @@
                $url = str_replace( '$1', $this->isbn, $url );
 
                return Html::rawElement( 'li', [],
-                       Html::element( 'a', [ 'href' => $url, 'class' => 
'external' ], $label ) );
+                       Html::element( 'a', [ 'href' => $url, 'class' => 
'external' ], $label )
+               );
        }
 
        protected function getGroupName() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ife378fe87c237123c299ded9a79286abeb8fa34b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to