Problem/Motivation

\Drupal\Tests\language\Traits\LanguageTestTrait::createLanguageFromLangcode documents the return type as \Drupal\Core\Language\ConfigurableLanguageInterface but it should be \Drupal\language\ConfigurableLanguageInterface. The native return type is correct. Since phpstan is configured to treat phpdoc types as certain it means we have 23 violations of this in the baseline.

Steps to reproduce

git grep 'ConfigurableLanguageInterface is not subtype' -- core/.phpstan-baseline.php

Proposed resolution

Fix the @return doc or remove it

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3636644

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

mstrelan created an issue. See original summary.

mstrelan’s picture

Status: Active » Needs review

MR fixes the namespace instead of removing it. I'd prefer to remove it, but don't remember if we're allowed to.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Wow that 1 line fixed so much. Nice find!

mstrelan’s picture

I understated it in the IS, it's two violations per instance, so 46 violations removed.