* Do not change the existing data, just add a new database row
*/
public static function provideRightsLogDatabaseRows() {
- return array(
+ return [
// Current format
- array(
- array(
+ [
+ [
'type' => 'rights',
'action' => 'rights',
'comment' => 'rights comment',
'user_text' => 'Sysop',
'namespace' => NS_USER,
'title' => 'User',
- 'params' => array(
- '4::oldgroups' => array(),
- '5::newgroups' => array( 'sysop', 'bureaucrat' ),
- ),
- ),
- array(
- 'text' => 'Sysop changed group membership for User:User from (none) to '
+ 'params' => [
+ '4::oldgroups' => [],
+ '5::newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [],
+ 'newmetadata' => [
+ [ 'expiry' => null ],
+ [ 'expiry' => '20160101123456' ]
+ ],
+ ],
+ ],
+ [
+ 'text' => 'Sysop changed group membership for User from (none) to '
+ . 'bureaucrat (temporary, until 12:34, 1 January 2016) and administrator',
+ 'api' => [
+ 'oldgroups' => [],
+ 'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => '2016-01-01T12:34:56Z' ],
+ ],
+ ],
+ ],
+ ],
+
+ // Previous format (oldgroups and newgroups as arrays, no metadata)
+ [
+ [
+ 'type' => 'rights',
+ 'action' => 'rights',
+ 'comment' => 'rights comment',
+ 'user' => 0,
+ 'user_text' => 'Sysop',
+ 'namespace' => NS_USER,
+ 'title' => 'User',
+ 'params' => [
+ '4::oldgroups' => [],
+ '5::newgroups' => [ 'sysop', 'bureaucrat' ],
+ ],
+ ],
+ [
+ 'text' => 'Sysop changed group membership for User from (none) to '
. 'administrator and bureaucrat',
- 'api' => array(
- 'oldgroups' => array(),
- 'newgroups' => array( 'sysop', 'bureaucrat' ),
- ),
- ),
- ),
+ 'api' => [
+ 'oldgroups' => [],
+ 'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => 'infinity' ],
+ ],
+ ],
+ ],
+ ],
- // Legacy format
- array(
- array(
+ // Legacy format (oldgroups and newgroups as numeric-keyed strings)
+ [
+ [
'type' => 'rights',
'action' => 'rights',
'comment' => 'rights comment',
'user_text' => 'Sysop',
'namespace' => NS_USER,
'title' => 'User',
- 'params' => array(
+ 'params' => [
'',
'sysop, bureaucrat',
- ),
- ),
- array(
+ ],
+ ],
+ [
'legacy' => true,
- 'text' => 'Sysop changed group membership for User:User from (none) to '
+ 'text' => 'Sysop changed group membership for User from (none) to '
. 'administrator and bureaucrat',
- 'api' => array(
- 'oldgroups' => array(),
- 'newgroups' => array( 'sysop', 'bureaucrat' ),
- ),
- ),
- ),
+ 'api' => [
+ 'oldgroups' => [],
+ 'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => 'infinity' ],
+ ],
+ ],
+ ],
+ ],
// Really old entry
- array(
- array(
+ [
+ [
'type' => 'rights',
'action' => 'rights',
'comment' => 'rights comment',
'user_text' => 'Sysop',
'namespace' => NS_USER,
'title' => 'User',
- 'params' => array(),
- ),
- array(
+ 'params' => [],
+ ],
+ [
'legacy' => true,
- 'text' => 'Sysop changed group membership for User:User',
- 'api' => array(),
- ),
- ),
- );
+ 'text' => 'Sysop changed group membership for User',
+ 'api' => [],
+ ],
+ ],
+ ];
}
/**
* Do not change the existing data, just add a new database row
*/
public static function provideAutopromoteLogDatabaseRows() {
- return array(
+ return [
// Current format
- array(
- array(
+ [
+ [
'type' => 'rights',
'action' => 'autopromote',
'comment' => 'rights comment',
'user_text' => 'Sysop',
'namespace' => NS_USER,
'title' => 'Sysop',
- 'params' => array(
- '4::oldgroups' => array( 'sysop' ),
- '5::newgroups' => array( 'sysop', 'bureaucrat' ),
- ),
- ),
- array(
+ 'params' => [
+ '4::oldgroups' => [ 'sysop' ],
+ '5::newgroups' => [ 'sysop', 'bureaucrat' ],
+ ],
+ ],
+ [
'text' => 'Sysop was automatically promoted from administrator to '
. 'administrator and bureaucrat',
- 'api' => array(
- 'oldgroups' => array( 'sysop' ),
- 'newgroups' => array( 'sysop', 'bureaucrat' ),
- ),
- ),
- ),
+ 'api' => [
+ 'oldgroups' => [ 'sysop' ],
+ 'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ ],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => 'infinity' ],
+ ],
+ ],
+ ],
+ ],
// Legacy format
- array(
- array(
+ [
+ [
'type' => 'rights',
'action' => 'autopromote',
'comment' => 'rights comment',
'user_text' => 'Sysop',
'namespace' => NS_USER,
'title' => 'Sysop',
- 'params' => array(
+ 'params' => [
'sysop',
'sysop, bureaucrat',
- ),
- ),
- array(
+ ],
+ ],
+ [
'legacy' => true,
'text' => 'Sysop was automatically promoted from administrator to '
. 'administrator and bureaucrat',
- 'api' => array(
- 'oldgroups' => array( 'sysop' ),
- 'newgroups' => array( 'sysop', 'bureaucrat' ),
- ),
- ),
- ),
- );
+ 'api' => [
+ 'oldgroups' => [ 'sysop' ],
+ 'newgroups' => [ 'sysop', 'bureaucrat' ],
+ 'oldmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ ],
+ 'newmetadata' => [
+ [ 'group' => 'sysop', 'expiry' => 'infinity' ],
+ [ 'group' => 'bureaucrat', 'expiry' => 'infinity' ],
+ ],
+ ],
+ ],
+ ],
+ ];
}
/**