* format (protect, delete, move, etc), and the just-do-something format (watch, rollback,
* patrol, etc). The FormAction and FormlessAction classes represent these two groups.
*/
-abstract class Action {
+abstract class Action implements MessageLocalizer {
/**
* Page on which we're performing the action
*
* @return Message
*/
- final public function msg() {
+ final public function msg( $key ) {
$params = func_get_args();
return call_user_func_array( [ $this->getContext(), 'msg' ], $params );
}
* Parameters are the same as wfMessage()
*
* @since 1.18
+ * @param string|string[]|MessageSpecifier $key Message key, or array of keys,
+ * or a MessageSpecifier.
* @param mixed ...
* @return Message
*/
- public function msg( /* $args */ ) {
+ public function msg( $key /* $args */ ) {
$args = func_get_args();
return call_user_func_array( [ $this->getContext(), 'msg' ], $args );
* it would set only the original context, and not take
* into account any changes.
*
+ * @param string|string[]|MessageSpecifier $key Message key, or array of keys,
+ * or a MessageSpecifier.
* @param mixed $args,... Arguments to wfMessage
* @return Message
*/
- public function msg() {
+ public function msg( $key ) {
$args = func_get_args();
return call_user_func_array( 'wfMessage', $args )->setContext( $this );
* belong here either. Session state changes should only be propagated on
* shutdown by separate persistence handler objects, for example.
*/
-interface IContextSource {
+interface IContextSource extends MessageLocalizer {
/**
* Get the WebRequest object
*
*/
public function getTiming();
- /**
- * Get a Message object with context set. See wfMessage for parameters.
- *
- * @param mixed ...
- * @return Message
- */
- public function msg();
-
/**
* Export the resolved user IP, HTTP headers, user ID, and session ID.
* The result will be reasonably sized to allow for serialization.
* Get a Message object with context set
* Parameters are the same as wfMessage()
*
+ * @param string|string[]|MessageSpecifier $key Message key, or array of keys,
+ * or a MessageSpecifier.
* @param mixed ...
* @return Message
*/
- public function msg() {
+ public function msg( $key ) {
$args = func_get_args();
return call_user_func_array( 'wfMessage', $args )->setContext( $this );
* Object passed around to modules which contains information about the state
* of a specific loader request.
*/
-class ResourceLoaderContext {
+class ResourceLoaderContext implements MessageLocalizer {
protected $resourceLoader;
protected $request;
protected $logger;
* Get a Message object with context set. See wfMessage for parameters.
*
* @since 1.27
+ * @param string|string[]|MessageSpecifier $key Message key, or array of keys,
+ * or a MessageSpecifier.
* @param mixed ...
* @return Message
*/
- public function msg() {
+ public function msg( $key ) {
return call_user_func_array( 'wfMessage', func_get_args() )
->inLanguage( $this->getLanguage() )
// Use a dummy title because there is no real title
*
* @ingroup SpecialPage
*/
-class SpecialPage {
+class SpecialPage implements MessageLocalizer {
// The canonical name of this special page
// Also used for the default <h1> heading, @see getDescription()
protected $mName;
* @return Message
* @see wfMessage
*/
- public function msg( /* $args */ ) {
+ public function msg( $key /* $args */ ) {
$message = call_user_func_array(
[ $this->getContext(), 'msg' ],
func_get_args()