dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MediaWikiTestCase::assertException() was removed
[lhc/web/wiklou.git]
/
includes
/
Autopromote.php
diff --git
a/includes/Autopromote.php
b/includes/Autopromote.php
index
81f3b7a
..
56fbb07
100644
(file)
--- a/
includes/Autopromote.php
+++ b/
includes/Autopromote.php
@@
-35,7
+35,7
@@
class Autopromote {
public static function getAutopromoteGroups( User $user ) {
global $wgAutopromote;
public static function getAutopromoteGroups( User $user ) {
global $wgAutopromote;
- $promote =
array()
;
+ $promote =
[]
;
foreach ( $wgAutopromote as $group => $cond ) {
if ( self::recCheckCondition( $cond, $user ) ) {
foreach ( $wgAutopromote as $group => $cond ) {
if ( self::recCheckCondition( $cond, $user ) ) {
@@
-43,7
+43,7
@@
class Autopromote {
}
}
}
}
-
wfRunHooks( 'GetAutoPromoteGroups', array( $user, &$promote )
);
+
Hooks::run( 'GetAutoPromoteGroups', [ $user, &$promote ]
);
return $promote;
}
return $promote;
}
@@
-63,7
+63,7
@@
class Autopromote {
public static function getAutopromoteOnceGroups( User $user, $event ) {
global $wgAutopromoteOnce;
public static function getAutopromoteOnceGroups( User $user, $event ) {
global $wgAutopromoteOnce;
- $promote =
array()
;
+ $promote =
[]
;
if ( isset( $wgAutopromoteOnce[$event] ) && count( $wgAutopromoteOnce[$event] ) ) {
$currentGroups = $user->getGroups();
if ( isset( $wgAutopromoteOnce[$event] ) && count( $wgAutopromoteOnce[$event] ) ) {
$currentGroups = $user->getGroups();
@@
-104,7
+104,7
@@
class Autopromote {
* @return bool Whether the condition is true
*/
private static function recCheckCondition( $cond, User $user ) {
* @return bool Whether the condition is true
*/
private static function recCheckCondition( $cond, User $user ) {
- $validOps =
array( '&', '|', '^', '!' )
;
+ $validOps =
[ '&', '|', '^', '!' ]
;
if ( is_array( $cond ) && count( $cond ) >= 2 && in_array( $cond[0], $validOps ) ) {
# Recursive condition
if ( is_array( $cond ) && count( $cond ) >= 2 && in_array( $cond[0], $validOps ) ) {
# Recursive condition
@@
-144,7
+144,7
@@
class Autopromote {
// If we got here, the array presumably does not contain other conditions;
// it's not recursive. Pass it off to self::checkCondition.
if ( !is_array( $cond ) ) {
// If we got here, the array presumably does not contain other conditions;
// it's not recursive. Pass it off to self::checkCondition.
if ( !is_array( $cond ) ) {
- $cond =
array( $cond )
;
+ $cond =
[ $cond ]
;
}
return self::checkCondition( $cond, $user );
}
return self::checkCondition( $cond, $user );
@@
-197,8
+197,8
@@
class Autopromote {
return in_array( 'bot', User::getGroupPermissions( $user->getGroups() ) );
default:
$result = null;
return in_array( 'bot', User::getGroupPermissions( $user->getGroups() ) );
default:
$result = null;
-
wfRunHooks( 'AutopromoteCondition', array(
$cond[0],
- array_slice( $cond, 1 ), $user, &$result
)
);
+
Hooks::run( 'AutopromoteCondition', [
$cond[0],
+ array_slice( $cond, 1 ), $user, &$result
]
);
if ( $result === null ) {
throw new MWException( "Unrecognized condition {$cond[0]} for autopromotion!" );
}
if ( $result === null ) {
throw new MWException( "Unrecognized condition {$cond[0]} for autopromotion!" );
}