Problem/Motivation

Follow up for #3128548: Add optional parameters to StatementInterface::fetchObject() to be in line with the PDO implementation of the method fetchObject() to add parameters to parameters to StatementInterface::fetchObject.
The required change is described on comment https://www.drupal.org/project/drupal/issues/3128548#comment-13943632

Steps to reproduce

Proposed resolution

Remaining tasks

Add patch.

User interface changes

None.

API changes

Data model changes

Release notes snippet

Issue fork drupal-3194677

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sokru created an issue. See original summary.

longwave’s picture

Status: Postponed » Active

I think this can be worked on now.

immaculatexavier’s picture

Status: Active » Needs review
StatusFileSize
new1.7 KB
immaculatexavier’s picture

StatusFileSize
new2.26 KB
immaculatexavier’s picture

Status: Needs review » Fixed
immaculatexavier’s picture

Status: Fixed » Needs review

#4 passed .

Kindly review

mondrake’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Database/StatementInterface.php
@@ -2,20 +2,19 @@
-// cSpell:ignore mydriver
-
 /**
  * Represents a prepared statement.
  *
  * Child implementations should either extend StatementWrapper:
+ *
  * @code
- * class Drupal\mymodule\Driver\Database\mydriver\Statement extends Drupal\Core\Database\StatementWrapper {}
+ * class Drupal\mymodule\Driver\Database\oracle\Statement extends Drupal\Core\Database\StatementWrapper {}
  * @endcode
  * or define their own class. If defining their own class, they will also have
  * to implement either the Iterator or IteratorAggregate interface before
  * Drupal\Core\Database\StatementInterface:
  * @code
- * class Drupal\mymodule\Driver\Database\mydriver\Statement implements Iterator, Drupal\Core\Database\StatementInterface {}
+ * class Drupal\mymodule\Driver\Database\oracle\Statement implements Iterator, Drupal\Core\Database\StatementInterface {}
  * @endcode

these changes are out of scope

+++ b/core/lib/Drupal/Core/Database/StatementInterface.php
@@ -114,25 +113,9 @@ public function fetch($mode = NULL, $cursor_orientation = NULL, $cursor_offset =
-   * Fetches the next row and returns it as an object.
-   *
-   * The object will be of the class specified by StatementInterface::setFetchMode()
-   * or stdClass if not specified.
-   *
-   * phpcs:disable Drupal.Commenting
-   * @todo Remove PHPCS overrides https://www.drupal.org/node/3194677.
-   *
-   * @param string|null $class_name
-   *   Name of the created class.
-   * @param array|null $constructor_arguments
-   *   Elements of this array are passed to the constructor.
-   * phpcs:enable
-   *
-   * @return mixed
-   *   The object of specified class or \stdClass if not specified. Returns
-   *   FALSE or NULL if there is no next row.
+   * {@inheritdoc}

only remove the phpcs:x directives and the @todo. The rest should stay (it's the interface doc, and the method is not inhertihed, so @inheritdoc is not appropriate here).

mondrake’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#3354672: [Meta] Adjust parameters in interfaces

Let's fix this for D11 in #3354672: [Meta] Adjust parameters in interfaces (it's too late for D10 now).