Problem/Motivation

During running the drupal-check on the Drupal 10 compatibility issue, phpstan reported the $config variable might be undefined in modules/sendgrid_integration_reports/src/Api.php. The changes there did not make sense as they are not related to the Drupal 10 compatibility, hence this issue is open. The problem here is, if the config variable is empty (i.e the config is not retrieved from factory), the following $start_date and $end_date variables will always have their default value, and not the one stored in config.

Also, there were some $stats_data variable checks where the variable did not exist possibly because of a type on the variable name.

Steps to reproduce

Proposed resolution

Retrieve the config before setting the variables.

$config = $this
    ->configFactory
    ->get('sendgrid_integration_reports.settings')
    ->get();

Rename occurrences of $statsdata to $stats_data

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

balintpekker created an issue. See original summary.

balintpekker’s picture

Status: Active » Needs review

Perignon made their first commit to this issue’s fork.

Perignon’s picture

Status: Needs review » Fixed

Merged PR

balintpekker’s picture

Status: Fixed » Closed (fixed)

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