Shouldn't getDerivativeId() be declared in MigrateDestinationInterface?

Created on 14 December 2023, 7 months ago

Problem/Motivation

Migrate version is actually 9.5.11 but the popup selector does not have that version listed.

I am calling a method which returns an object that implements a MigrateDestinationInterface object (the return type of the method is MigrateDestinationInterface), and then I call getDerivativeId() on that object. The code works fine.

However, when analyzed with phpstan, I get the following error message:

Call to an undefined method Drupal\migrate\Plugin\MigrateDestinationInterface::getDerivativeId().

This is because this method is not declared in MigrateDestinationInterface. If I declare it there, the issue goes away.

I have used getDerivativeId() on many MigrateDestination objects, and have never yet encountered one that did not implement getDerivativeId(). Code samples I have seen online also seem to assume that this method should always exist on a MigrateDestination. So, would I be wrong to think that perhaps this method should be declared in the Interface?

πŸ’¬ Support request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States apotek

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @apotek
  • Assigned to apotek
  • Status changed to Closed: works as designed 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States apotek

    Of course, shortly after posting, I did find a destination plugin that does not derive from Entity and therefore doesn't implement getDerivativeId(). So this question is moot :(

Production build 0.69.0 2024