Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The sniff Drupal.Classes.ClassCreateInstance.ParenthesisMissing is reporting a false positive 'Calling class constructors must always include parentheses' for the following code if (!isset($this->destinationPlugin)) {. The larger code example is:
/**
* The destination plugin.
*
* @var \Drupal\migrate\Plugin\MigrateDestinationInterface
*/
protected $destinationPlugin;
/**
* {@inheritdoc}
*/
public function getDestinationPlugin($stub_being_requested = FALSE) {
if (!isset($this->destinationPlugin)) {
if ($stub_being_requested && !empty($this->destination['no_stub'])) {
throw new MigrateSkipRowException;
}
$this->destinationPlugin = \Drupal::service('plugin.manager.migrate.destination')->createInstance($this->destination['plugin'], $this->destination, $this);
}
return $this->destinationPlugin;
}
Comments
Comment #2
klausiBut the statement "throw new MigrateSkipRowException;" is missing parenthesis, so that should be reported? Is it reporting on the wrong line?
Comment #3
klausiClosing due to lack of activity.