From: Timo Tijhof Date: Mon, 8 Jun 2015 14:15:18 +0000 (+0100) Subject: Minor code clean up in SpecialBooksources X-Git-Tag: 1.31.0-rc.0~7906^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=66b7ba269abac33fa1aa9d10e90822ae531099ad;p=lhc%2Fweb%2Fwiklou.git Minor code clean up in SpecialBooksources Change-Id: Ife378fe87c237123c299ded9a79286abeb8fa34b --- diff --git a/includes/specials/SpecialBooksources.php b/includes/specials/SpecialBooksources.php index d185203d4d..fe90a4f90c 100644 --- a/includes/specials/SpecialBooksources.php +++ b/includes/specials/SpecialBooksources.php @@ -34,9 +34,6 @@ class SpecialBookSources extends SpecialPage { */ private $isbn = ''; - /** - * Constructor - */ public function __construct() { parent::__construct( 'Booksources' ); } @@ -49,9 +46,9 @@ class SpecialBookSources extends SpecialPage { 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( "
\n$1\n
", @@ -63,7 +60,8 @@ class SpecialBookSources extends SpecialPage { } /** - * 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 @@ class SpecialBookSources extends SpecialPage { * format and output them * * @throws MWException - * @return string + * @return bool */ private function showList() { global $wgContLang; @@ -205,7 +203,8 @@ class SpecialBookSources extends SpecialPage { $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() {