Problem/Motivation

When using the decorator pattern with `__call()` to proxy method calls to an inner object, methods that have parameters passed by reference (e.g., `&$complete_form`) fail with a warning.

Proposed resolution

Replace call_user_func_array() with the spread operator (...) in the __call() method:

public function __call($method, $args) {
    return $this->inner->$method(...$args);
}
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

harlor created an issue. See original summary.

harlor’s picture

Issue summary: View changes

harlor’s picture

Status: Active » Needs review

  • harlor committed 0b499175 on 1.0.x
    feat: #3568809 __call() proxy breaks methods with reference parameters...
harlor’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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