Use PHP 7.4 featers and PHP 8 polyfills

This commit is contained in:
David Stone
2025-02-08 13:57:32 -07:00
parent 8bea6067cd
commit b41dc2b2eb
550 changed files with 15270 additions and 14627 deletions

View File

@ -88,10 +88,10 @@ class Limit_Subtype extends Limit {
*/
public function get_default_permissions($type) {
return array(
return [
'enabled' => true,
'number' => '', // unlimited
);
];
}
/**
@ -104,7 +104,7 @@ class Limit_Subtype extends Limit {
*/
public function exists($type) {
$results = wu_get_isset($this->get_limit(), $type, array());
$results = wu_get_isset($this->get_limit(), $type, []);
return wu_get_isset($results, 'number', 'not-set') !== 'not-set';
}
@ -117,7 +117,7 @@ class Limit_Subtype extends Limit {
*/
public function handle_limit() {
$received = wu_get_isset($_POST['modules'][ $this->id ], 'limit', array());
$received = wu_get_isset($_POST['modules'][ $this->id ], 'limit', []);
foreach ($received as $post_type => &$limitations) {
$limitations['enabled'] = (bool) wu_get_isset($_POST['modules'][ $this->id ]['limit'][ $post_type ], 'enabled', false);