*
* @file
* @author Alexandre Emsenhuber
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
+ * @license GPL-2.0-or-later
* @since 1.22
*/
if ( count( $oldGroups ) ) {
$params[3] = [ 'raw' => $this->formatRightsList( $oldGroups,
- isset( $allParams['oldmetadata'] ) ? $allParams['oldmetadata'] : [] ) ];
+ $allParams['oldmetadata'] ?? [] ) ];
} else {
$params[3] = $this->msg( 'rightsnone' )->text();
}
// Array_values is used here because of T44211
// see use of array_unique in UserrightsPage::doSaveUserGroups on $newGroups.
$params[4] = [ 'raw' => $this->formatRightsList( array_values( $newGroups ),
- isset( $allParams['newmetadata'] ) ? $allParams['newmetadata'] : [] ) ];
+ $allParams['newmetadata'] ?? [] ) ];
} else {
$params[4] = $this->msg( 'rightsnone' )->text();
}
$oldmetadata =& $params['oldmetadata'];
// unset old metadata entry to ensure metadata goes at the end of the params array
unset( $params['oldmetadata'] );
- $params['oldmetadata'] = array_map( function( $index ) use ( $params, $oldmetadata ) {
+ $params['oldmetadata'] = array_map( function ( $index ) use ( $params, $oldmetadata ) {
$result = [ 'group' => $params['4:array:oldgroups'][$index] ];
if ( isset( $oldmetadata[$index] ) ) {
$result += $oldmetadata[$index];
}
- $result['expiry'] = ApiResult::formatExpiry( isset( $result['expiry'] ) ?
- $result['expiry'] : null );
+ $result['expiry'] = ApiResult::formatExpiry( $result['expiry'] ?? null );
return $result;
}, array_keys( $params['4:array:oldgroups'] ) );
$newmetadata =& $params['newmetadata'];
// unset old metadata entry to ensure metadata goes at the end of the params array
unset( $params['newmetadata'] );
- $params['newmetadata'] = array_map( function( $index ) use ( $params, $newmetadata ) {
+ $params['newmetadata'] = array_map( function ( $index ) use ( $params, $newmetadata ) {
$result = [ 'group' => $params['5:array:newgroups'][$index] ];
if ( isset( $newmetadata[$index] ) ) {
$result += $newmetadata[$index];
}
- $result['expiry'] = ApiResult::formatExpiry( isset( $result['expiry'] ) ?
- $result['expiry'] : null );
+ $result['expiry'] = ApiResult::formatExpiry( $result['expiry'] ?? null );
return $result;
}, array_keys( $params['5:array:newgroups'] ) );