Issue fork drupal-3156847

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

Ayesh created an issue. See original summary.

ayesh’s picture

StatusFileSize
new5.59 KB
ayesh’s picture

sjerdo’s picture

We shouldn't just make all subsequent parameters optional
Eg for SelectQuery, the parent class Query requires the $connection parameter, which was made optional in patch #2
https://3v4l.org/A3j9G

+++ b/includes/database/select.inc
@@ -964,7 +964,7 @@ class SelectQuery extends Query implements SelectQueryInterface {
+  public function __construct($table, $alias = NULL, DatabaseConnection $connection = NULL, $options = array()) {

We should change this so $alias is required too (but allow null). Parameter $connection is required by the parent class.

See https://3v4l.org/A3j9G

ayesh’s picture

StatusFileSize
new5.73 KB

You are right, thanks @sjerdo.
I updated the patch with that method now making `$alias` parameter a required one.

Taran2L made their first commit to this issue’s fork.

taran2l’s picture

hi @Ayesh, I've made a few changes and opened an MR. Please review.

In general, I think optional params can safely be made required because when the corresponding code is being called they are always set anyway with a few exceptions. Please see my comments in MR

taran2l’s picture

Status: Active » Needs review
fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Setting to RTBC

mcdruid made their first commit to this issue’s fork.

  • mcdruid committed f5a0ff9 on 7.x
    Issue #3156847 by Ayesh, Taran2L, sjerdo: [PHP 8] Parameter order fixes
    
mcdruid’s picture

Status: Reviewed & tested by the community » Fixed

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

poker10 credited apaderno.

poker10’s picture