jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/371951 )
Change subject: Move RawMessage out of Message.php to its own file ...................................................................... Move RawMessage out of Message.php to its own file Change-Id: Idae9617dafa3c314085eb097f78f1c8d38672f31 --- M autoload.php M includes/Message.php A includes/RawMessage.php 3 files changed, 73 insertions(+), 54 deletions(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 508e75b..d9e85bd 100644 --- a/autoload.php +++ b/autoload.php @@ -1180,7 +1180,7 @@ 'RangeChronologicalPager' => __DIR__ . '/includes/pager/RangeChronologicalPager.php', 'RangeDifference' => __DIR__ . '/includes/diff/DiffEngine.php', 'RawAction' => __DIR__ . '/includes/actions/RawAction.php', - 'RawMessage' => __DIR__ . '/includes/Message.php', + 'RawMessage' => __DIR__ . '/includes/RawMessage.php', 'ReadOnlyError' => __DIR__ . '/includes/exception/ReadOnlyError.php', 'ReadOnlyMode' => __DIR__ . '/includes/ReadOnlyMode.php', 'ReassignEdits' => __DIR__ . '/maintenance/reassignEdits.php', diff --git a/includes/Message.php b/includes/Message.php index 8777c6f..0240fa7 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -1344,56 +1344,3 @@ return $this->extractParam( new RawMessage( $vars, $params ), $format ); } } - -/** - * Variant of the Message class. - * - * Rather than treating the message key as a lookup - * value (which is passed to the MessageCache and - * translated as necessary), a RawMessage key is - * treated as the actual message. - * - * All other functionality (parsing, escaping, etc.) - * is preserved. - * - * @since 1.21 - */ -class RawMessage extends Message { - - /** - * Call the parent constructor, then store the key as - * the message. - * - * @see Message::__construct - * - * @param string $text Message to use. - * @param array $params Parameters for the message. - * - * @throws InvalidArgumentException - */ - public function __construct( $text, $params = [] ) { - if ( !is_string( $text ) ) { - throw new InvalidArgumentException( '$text must be a string' ); - } - - parent::__construct( $text, $params ); - - // The key is the message. - $this->message = $text; - } - - /** - * Fetch the message (in this case, the key). - * - * @return string - */ - public function fetchMessage() { - // Just in case the message is unset somewhere. - if ( $this->message === null ) { - $this->message = $this->key; - } - - return $this->message; - } - -} diff --git a/includes/RawMessage.php b/includes/RawMessage.php new file mode 100644 index 0000000..9a0d947 --- /dev/null +++ b/includes/RawMessage.php @@ -0,0 +1,72 @@ +<?php +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +/** + * Variant of the Message class. + * + * Rather than treating the message key as a lookup + * value (which is passed to the MessageCache and + * translated as necessary), a RawMessage key is + * treated as the actual message. + * + * All other functionality (parsing, escaping, etc.) + * is preserved. + * + * @since 1.21 + */ +class RawMessage extends Message { + + /** + * Call the parent constructor, then store the key as + * the message. + * + * @see Message::__construct + * + * @param string $text Message to use. + * @param array $params Parameters for the message. + * + * @throws InvalidArgumentException + */ + public function __construct( $text, $params = [] ) { + if ( !is_string( $text ) ) { + throw new InvalidArgumentException( '$text must be a string' ); + } + + parent::__construct( $text, $params ); + + // The key is the message. + $this->message = $text; + } + + /** + * Fetch the message (in this case, the key). + * + * @return string + */ + public function fetchMessage() { + // Just in case the message is unset somewhere. + if ( $this->message === null ) { + $this->message = $this->key; + } + + return $this->message; + } + +} -- To view, visit https://gerrit.wikimedia.org/r/371951 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idae9617dafa3c314085eb097f78f1c8d38672f31 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits