* The prototype for a token function is func($pageid, $title)
* it should return a token or false (permission denied)
* @deprecated since 1.24
- * @return array Array(tokenname => function)
+ * @return array [ tokenname => function ]
*/
protected function getTokenFunctions() {
// Don't call the hooks twice
foreach ( $this->params['token'] as $t ) {
$val = call_user_func( $tokenFunctions[$t], $pageid, $title );
if ( $val === false ) {
- $this->setWarning( "Action '$t' is not allowed for the current user" );
+ $this->addWarning( [ 'apiwarn-tokennotallowed', $t ] );
} else {
$pageInfo[$t . 'token'] = $val;
}