No need to pass $this in static function:
$prune_age_options = WatchdogPruneSettings::prune_age_options($this);

As per Alexpot comment https://www.drupal.org/node/2858062#comment-11983172

Also need following code cleanup for t() function.

 protected static function prune_age_options($classRef) {
    $prune_age_options = [
    '' => $classRef->t('None - do not prune based on age'),
    '-1 MONTH' => $classRef->t('1 month'),
    '-2 MONTHS' => $classRef->t('2 months'),
    '-3 MONTHS' => $classRef->t('3 months'),
    '-6 MONTHS' => $classRef->t('6 months'),
    '-9 MONTHS' => $classRef->t('9 months'),
    '-12 MONTHS' => $classRef->t('12 months (1 year)'),
    '-18 MONTHS' => $classRef->t('18 months (1.5 years)'),
    '-24 MONTHS' => $classRef->t('24 months (2 years)'),
    '-30 MONTHS' => $classRef->t('30 months (2.5 years)'),
    '-36 MONTHS' => $classRef->t('36 months (3 years)'),
    ];

    return $prune_age_options;
  }

Comments

sandeepscs created an issue. See original summary.

smaaz’s picture

Please find the attached file patch.

vickynandode’s picture

Status: Needs work » Reviewed & tested by the community

Verified the patch, it's working fine
Changed the status to RTBC

  • vishwac9 committed 3c11540 on 8.x-1.x authored by sandeepscs
    Issue #2860499 by smaaz, sandeepscs, vickynandode, vishwac9, richardp:...

vishwac9 credited richardp.

vishwac9 credited vishwac9.

vishwac9’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, learning new things everyday. It does seems a good issue as static methods belongs to a Class and not to any instance objects. Anyways Will follow the issue as commented on by Alex Pott, as his comment looks confusing to me.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.