Issue #3299327 by andypost, Berdir: Replace deprecated static::method() calls for PHP 8.2
parent
db2e2d2544
commit
876e17f576
|
@ -155,7 +155,7 @@ class AssetResolver implements AssetResolverInterface {
|
|||
$this->themeManager->alter('css', $css, $assets);
|
||||
|
||||
// Sort CSS items, so that they appear in the correct order.
|
||||
uasort($css, 'static::sort');
|
||||
uasort($css, [static::class, 'sort']);
|
||||
|
||||
if ($optimize) {
|
||||
$css = \Drupal::service('asset.css.collection_optimizer')->optimize($css);
|
||||
|
@ -262,7 +262,7 @@ class AssetResolver implements AssetResolverInterface {
|
|||
$this->themeManager->alter('js', $javascript, $assets);
|
||||
|
||||
// Sort JavaScript assets, so that they appear in the correct order.
|
||||
uasort($javascript, 'static::sort');
|
||||
uasort($javascript, [static::class, 'sort']);
|
||||
|
||||
// Prepare the return value: filter JavaScript assets per scope.
|
||||
$js_assets_header = [];
|
||||
|
|
|
@ -125,7 +125,7 @@ class MailFormatHelper {
|
|||
// 'See the Drupal site [1]' with the URL included as a footnote.
|
||||
static::htmlToMailUrls(NULL, TRUE);
|
||||
$pattern = '@(<a[^>]+?href="([^"]*)"[^>]*?>(.+?)</a>)@i';
|
||||
$string = preg_replace_callback($pattern, 'static::htmlToMailUrls', $string);
|
||||
$string = preg_replace_callback($pattern, [static::class, 'htmlToMailUrls'], $string);
|
||||
$urls = static::htmlToMailUrls();
|
||||
$footnotes = '';
|
||||
if (count($urls)) {
|
||||
|
|
|
@ -37,7 +37,7 @@ class Element {
|
|||
* An array of property keys for the element.
|
||||
*/
|
||||
public static function properties(array $element) {
|
||||
return array_filter(array_keys($element), 'static::property');
|
||||
return array_filter(array_keys($element), [static::class, 'property']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -169,7 +169,7 @@ class Role extends ConfigEntityBase implements RoleInterface {
|
|||
parent::postLoad($storage, $entities);
|
||||
// Sort the queried roles by their weight.
|
||||
// See \Drupal\Core\Config\Entity\ConfigEntityBase::sort().
|
||||
uasort($entities, 'static::sort');
|
||||
uasort($entities, [static::class, 'sort']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -111,7 +111,7 @@ class Date extends NumericFilter {
|
|||
// one greater.
|
||||
$operators = $this->operators();
|
||||
$expected = $operators[$group['operator']]['values'] + 1;
|
||||
$actual = count(array_filter($group['value'], 'static::arrayFilterZero'));
|
||||
$actual = count(array_filter($group['value'], [static::class, 'arrayFilterZero']));
|
||||
|
||||
return $actual == $expected;
|
||||
}
|
||||
|
|
|
@ -704,7 +704,7 @@ abstract class FilterPluginBase extends HandlerBase implements CacheableDependen
|
|||
// types). Ensure at least the minimum number of values is present for
|
||||
// this entry to be considered valid.
|
||||
$min_values = $operators[$group['operator']]['values'];
|
||||
$actual_values = count(array_filter($group['value'], 'static::arrayFilterZero'));
|
||||
$actual_values = count(array_filter($group['value'], [static::class, 'arrayFilterZero']));
|
||||
return $actual_values >= $min_values;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ class ManyToOne extends InOperator {
|
|||
}
|
||||
// Form API returns unchecked options in the form of option_id => 0. This
|
||||
// breaks the generated query for "is all of" filters so we remove them.
|
||||
$this->value = array_filter($this->value, 'static::arrayFilterZero');
|
||||
$this->value = array_filter($this->value, [static::class, 'arrayFilterZero']);
|
||||
$this->helper->addFilter();
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ class ViewsDataHelper {
|
|||
$strings += $this->fields[$base_table][$type];
|
||||
}
|
||||
}
|
||||
uasort($strings, ['self', 'fetchedFieldSort']);
|
||||
uasort($strings, [self::class, 'fetchedFieldSort']);
|
||||
return $strings;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue