MediaWiki REL1_34
ExprError.php
Go to the documentation of this file.
1<?php
20
21use Exception;
22use Message;
23
24class ExprError extends Exception {
26 private $mwMessage;
27
32 public function __construct( $msg, $parameter = '' ) {
33 // Give grep a chance to find the usages:
34 // pfunc_expr_stack_exhausted, pfunc_expr_unexpected_number, pfunc_expr_preg_match_failure,
35 // pfunc_expr_unrecognised_word, pfunc_expr_unexpected_operator, pfunc_expr_missing_operand,
36 // pfunc_expr_unexpected_closing_bracket, pfunc_expr_unrecognised_punctuation,
37 // pfunc_expr_unclosed_bracket, pfunc_expr_division_by_zero, pfunc_expr_invalid_argument,
38 // pfunc_expr_invalid_argument_ln, pfunc_expr_unknown_error, pfunc_expr_not_a_number
39 $this->mwMessage = wfMessage( "pfunc_expr_$msg", $parameter );
40 }
41
48 public function getUserFriendlyMessage() {
49 return $this->mwMessage->inContentLanguage()->text();
50 }
51}
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
getUserFriendlyMessage()
Replacement for getMessage() to prevent message parsing during tests which initializes whole bloody M...
Definition ExprError.php:48
The Message class provides methods which fulfil two basic services:
Definition Message.php:162
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
Definition ExprError.php:19