Fix return type in \Drupal\Core\Database\Query\Merge::__toString

Created on 18 September 2023, 9 months ago
Updated 28 April 2024, about 2 months ago

Problem/Motivation

  /**
   * Implements PHP magic __toString method to convert the query to a string.
   *
   * In the degenerate case, there is no string-able query as this operation
   * is potentially two queries.
   *
   * @return string
   *   The prepared query statement.
   */
  public function __toString() {
  }

This causes errors in phpcs with Drupal.Commenting.FunctionComment.InvalidNoReturn enabled and also phpstan.

It was added in commit 67429ab19fd6bc03295831270054ad40bd2c9163 in 2011 and does not have a d.o issue.

In #2722647-59: [Meta] Fix Drupal.Commenting.FunctionComment.InvalidNoReturn 3) xjm stated, "This is an actual behavior change and seems like it needs its own issue, with tests"

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Other 

Last updated about 2 hours ago

Created by

🇳🇿New Zealand quietone New Zealand

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024