Problem/Motivation

config_pages_config() can return NULL but the docblock does not acknowledge that.

Steps to reproduce

When doing something like this:

if ($page = config_pages_config('foo')) {
  // Do something with it
}

drupal-check is complaining:

If condition is always true.

Proposed resolution

The return type should be \Drupal\config_pages\Entity\ConfigPages|null.

Remaining tasks

I will submit a patch.

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:

Comments

prudloff created an issue. See original summary.

prudloff’s picture

Status: Active » Needs review
shumer’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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