*
* @code
* // old style:
- * wfMsgExt( 'key', array( 'parseinline' ), 'apple' );
+ * wfMsgExt( 'key', [ 'parseinline' ], 'apple' );
* // new style:
* wfMessage( 'key', 'apple' )->parse();
* @endcode
* Places where HTML cannot be used. {{-transformation is done.
* @code
* // old style:
- * wfMsgExt( 'key', array( 'parsemag' ), 'apple', 'pear' );
+ * wfMsgExt( 'key', [ 'parsemag' ], 'apple', 'pear' );
* // new style:
* wfMessage( 'key', 'apple', 'pear' )->text();
* @endcode
* @return string
*/
public function __toString() {
+ if ( $this->format !== 'parse' ) {
+ $ex = new LogicException( __METHOD__ . ' using implicit format: ' . $this->format );
+ \MediaWiki\Logger\LoggerFactory::getInstance( 'message-format' )->warning(
+ $ex->getMessage(), [ 'exception' => $ex, 'format' => $this->format, 'key' => $this->key ] );
+ }
+
// PHP doesn't allow __toString to throw exceptions and will
// trigger a fatal error if it does. So, catch any exceptions.