Add Message::listParam()
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 2 Nov 2016 16:53:19 +0000 (12:53 -0400)
committerAnomie <bjorsch@wikimedia.org>
Wed, 30 Nov 2016 15:54:17 +0000 (15:54 +0000)
commit3041b5c038216ce4520c5fffb87fec5f8ed2db9d
tree9a5f232e189a6e4665c0b0a7f11c587fbcb5ac26
parent5a1104444f3d71d3f696f130de79b315f86e15cc
Add Message::listParam()

This allows for passing a list of values that will be turned into a list
in the context of the language for which the Message is being processed.

For example, currently you'd have to do

 $msg = new Message( 'something', [ $language->commaList( $list ) ] );

which isn't going to give correct results if the message is later
changed to a different language with a different value for
'comma-separator'.

Now, you can do this instead

 $msg = new Message( 'something', [ Message::listParam( $list, 'comma' ) ] );

and it will be listified properly no matter what language is later used to
parse $msg.

Change-Id: I66868c61832260870449998fef14c842f17753ee
includes/Message.php
includes/api/ApiPageSet.php
tests/phpunit/includes/MessageTest.php