Commit 876e17f5 authored by catch's avatar catch
Browse files

Issue #3299327 by andypost, Berdir: Replace deprecated static::method() calls for PHP 8.2

parent db2e2d25
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize) {
    $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 @@ public function getJsAssets(AttachedAssetsInterface $assets, $optimize) {
      $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 = [];
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public static function htmlToText($string, $allowed_tags = NULL) {
    // '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)) {
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public static function property($key) {
   *   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']);
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ public static function postLoad(EntityStorageInterface $storage, array &$entitie
    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']);
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ protected function hasValidGroupedValue(array $group) {
    // 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;
  }
Loading