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

Lars Toomre created an issue. See original summary.

klausi’s picture

Status: Active » Postponed (maintainer needs more info)

But the statement "throw new MigrateSkipRowException;" is missing parenthesis, so that should be reported? Is it reporting on the wrong line?

klausi’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Closing due to lack of activity.