Problem/Motivation

Discovered via PHPStan in #3178534: Start running PHPStan on Drupal core (level 0):

  Line   core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php                         
 ------ ------------------------------------------------------------------------------- 
  264    Caught class Drupal\Core\KeyValueStore\SchemaObjectExistsException not found.

Line 264 is:

    catch (SchemaObjectExistsException $e) {

The correct class is Drupal\Core\Database\SchemaObjectExistsException but the use statement is missing.

Steps to reproduce

Proposed resolution

Add the missing use statement.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review
FileSize
565 bytes
Abhijith S’s picture

FileSize
41.58 KB

Applied patch #2 and it adds the missing class.

after

Kingdutch’s picture

Status: Needs review » Reviewed & tested by the community

Moving to RTBC as per #3 and manually confirmed the patch looks correct.

  • catch committed 7f6d534 on 9.2.x
    Issue #3205026 by longwave: Missing use statement in Drupal\Core\...

  • catch committed c504288 on 9.1.x
    Issue #3205026 by longwave: Missing use statement in Drupal\Core\...
catch’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 7f6d534 and pushed to 9.2.x. Thanks! Also cherry-picked to 9.1.x

Status: Fixed » Closed (fixed)

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