* Get a Message object with context set
* Parameters are the same as wfMessage()
*
+ * @param string|string[]|MessageSpecifier $key
+ * @param mixed ...$params
* @return Message
*/
- final public function msg( $key ) {
- $params = func_get_args();
- return $this->getContext()->msg( ...$params );
+ final public function msg( $key, ...$params ) {
+ return $this->getContext()->msg( $key, ...$params );
}
/**
* @since 1.18
* @param string|string[]|MessageSpecifier $key Message key, or array of keys,
* or a MessageSpecifier.
- * @param mixed $args,...
- * @suppress PhanCommentParamWithoutRealParam HHVM bug T228695#5450847
+ * @param mixed ...$params
* @return Message
*/
- public function msg( $key /* $args */ ) {
- $args = func_get_args();
-
- return $this->getContext()->msg( ...$args );
+ public function msg( $key, ...$params ) {
+ return $this->getContext()->msg( $key, ...$params );
}
/**
*
* @param string|string[]|MessageSpecifier $key Message key, or array of keys,
* or a MessageSpecifier.
- * @param mixed $args,... Arguments to wfMessage
- * @suppress PhanCommentParamWithoutRealParam HHVM bug T228695#5450847
+ * @param mixed ...$params
* @return Message
*/
- public function msg( $key ) {
- $args = func_get_args();
-
+ public function msg( $key, ...$params ) {
// phpcs:ignore MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage
- return wfMessage( ...$args )->setContext( $this );
+ return wfMessage( $key, ...$params )->setContext( $this );
}
}
*
* @param string|string[]|MessageSpecifier $key Message key, or array of keys,
* or a MessageSpecifier.
- * @param mixed $args,...
- * @suppress PhanCommentParamWithoutRealParam HHVM bug T228695#5450847
+ * @param mixed ...$params
* @return Message
*/
- public function msg( $key ) {
- $args = func_get_args();
-
- return wfMessage( ...$args )->setContext( $this );
+ public function msg( $key, ...$params ) {
+ return wfMessage( $key, ...$params )->setContext( $this );
}
/**
*
* Parameters are the same as wfMessage().
*
+ * @param string|string[]|MessageSpecifier $key
+ * @param mixed ...$params
* @return Message
*/
- public function msg() {
- $args = func_get_args();
-
+ public function msg( $key, ...$params ) {
if ( $this->mParent ) {
- return $this->mParent->msg( ...$args );
+ return $this->mParent->msg( $key, ...$params );
}
- return wfMessage( ...$args );
+ return wfMessage( $key, ...$params );
}
/**
*
* @param string|string[]|MessageSpecifier $key Message key, or array of keys,
* or a MessageSpecifier.
- * @param mixed $params,... Normal message parameters
- * @suppress PhanCommentParamWithoutRealParam HHVM bug T228695#5450847
+ * @param mixed ...$params Normal message parameters
* @return Message
*/
- public function msg( $key /*...*/ );
+ public function msg( $key, ...$params );
}
/**
* Shortcut for wfMessage which honors local context.
* @param string $key
+ * @param mixed ...$params
* @return Message
*/
- protected function msg( $key ) {
- return $this->context->msg( $key );
+ protected function msg( $key, ...$params ) {
+ return $this->context->msg( $key, ...$params );
}
/**
* @since 1.27
* @param string|string[]|MessageSpecifier $key Message key, or array of keys,
* or a MessageSpecifier.
- * @param mixed $args,...
- * @suppress PhanCommentParamWithoutRealParam HHVM bug T228695#5450847
+ * @param mixed ...$params
* @return Message
*/
- public function msg( $key ) {
- return wfMessage( ...func_get_args() )
+ public function msg( $key, ...$params ) {
+ return wfMessage( $key, ...$params )
->inLanguage( $this->getLanguage() )
// Use a dummy title because there is no real title
// for this endpoint, and the cache won't vary on it
* Wrapper around wfMessage that sets the current context.
*
* @since 1.16
+ * @param string|string[]|MessageSpecifier $key
+ * @param mixed ...$params
* @return Message
* @see wfMessage
*/
- public function msg( $key /* $args */ ) {
- $message = $this->getContext()->msg( ...func_get_args() );
+ public function msg( $key, ...$params ) {
+ $message = $this->getContext()->msg( $key, ...$params );
// RequestContext passes context to wfMessage, and the language is set from
// the context, but setting the language for Message class removes the
// interface message status, which breaks for example usernameless gender
*
* @param string|string[]|MessageSpecifier $key Message key, or array of keys,
* or a MessageSpecifier.
- * @param mixed $args,...
+ * @param mixed ...$params
* @return Message
*/
- public function msg( $key ) {
- $args = func_get_args();
-
- /** @var Message $message */
- $message = wfMessage( ...$args );
+ public function msg( $key, ...$params ) {
+ $message = wfMessage( $key, ...$params );
if ( $this->languageCode !== null ) {
$message->inLanguage( $this->languageCode );