From: Bartosz DziewoƄski Date: Mon, 7 May 2018 18:48:01 +0000 (+0200) Subject: LogPager/LogEventsList: Correct docs about $pattern parameter X-Git-Tag: 1.34.0-rc.0~5453 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E//%22%24curUrl/%22?a=commitdiff_plain;h=286cdb83829fadacfc3af0792bcd38c2d0fb840a;p=lhc%2Fweb%2Fwiklou.git LogPager/LogEventsList: Correct docs about $pattern parameter $pattern is a boolean, it is documented as "Do a prefix search rather than an exact title match". However, its type was incorrectly documented to be a string, and the default value was '' instead of false (which was harmless, as it is correctly treated as a boolean value everywhere). Change-Id: Id093d12891a231d5934f9908e619065afff7380e --- diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 93a81cff8e..9e4a630bd0 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -97,7 +97,7 @@ class LogEventsList extends ContextSource { * @param array|string $types * @param string $user * @param string $page - * @param string $pattern + * @param bool $pattern * @param int|string $year Use 0 to start with no year preselected. * @param int|string $month A month in the 1..12 range. Use 0 to start with no month * preselected. @@ -105,7 +105,7 @@ class LogEventsList extends ContextSource { * @param string $tagFilter Tag to select by default * @param string $action */ - public function showOptions( $types = [], $user = '', $page = '', $pattern = '', $year = 0, + public function showOptions( $types = [], $user = '', $page = '', $pattern = false, $year = 0, $month = 0, $filter = null, $tagFilter = '', $action = null ) { global $wgScript, $wgMiserMode; @@ -289,7 +289,7 @@ class LogEventsList extends ContextSource { } /** - * @param string $pattern + * @param bool $pattern * @return string Checkbox */ private function getTitlePattern( $pattern ) { diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index c047e96ea3..84653b1ba1 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -36,8 +36,8 @@ class LogPager extends ReverseChronologicalPager { /** @var string|Title Events limited to those about Title when set */ private $title = ''; - /** @var string */ - private $pattern = ''; + /** @var bool */ + private $pattern = false; /** @var string */ private $typeCGI = ''; @@ -59,7 +59,7 @@ class LogPager extends ReverseChronologicalPager { * @param string|array $types Log types to show * @param string $performer The user who made the log entries * @param string|Title $title The page title the log entries are for - * @param string $pattern Do a prefix search rather than an exact title match + * @param bool $pattern Do a prefix search rather than an exact title match * @param array $conds Extra conditions for the query * @param int|bool $year The year to start from. Default: false * @param int|bool $month The month to start from. Default: false @@ -68,7 +68,7 @@ class LogPager extends ReverseChronologicalPager { * @param int $logId Log entry ID, to limit to a single log entry. */ public function __construct( $list, $types = [], $performer = '', $title = '', - $pattern = '', $conds = [], $year = false, $month = false, $tagFilter = '', + $pattern = false, $conds = [], $year = false, $month = false, $tagFilter = '', $action = '', $logId = false ) { parent::__construct( $list->getContext() ); @@ -194,7 +194,7 @@ class LogPager extends ReverseChronologicalPager { * (For the block and rights logs, this is a user page.) * * @param string|Title $page Title name - * @param string $pattern + * @param bool $pattern * @return void */ private function limitTitle( $page, $pattern ) { @@ -398,6 +398,9 @@ class LogPager extends ReverseChronologicalPager { return $this->title; } + /** + * @return bool + */ public function getPattern() { return $this->pattern; }