Skip to content

Commit

Permalink
bug #37774 [Console] Make sure we pass a numeric array of arguments t…
Browse files Browse the repository at this point in the history
…o call_user_func_array() (derrabus)

This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Make sure we pass a numeric array of arguments to call_user_func_array()

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

On php 8, the unit tests fail with the following error:

```
ArgumentCountError: array_merge() does not accept unknown named parameters
```

This PR should fix the issue.

Commits
-------

67102c32e6 [Console] Make sure we pass a numeric array of arguments to call_user_func_array().
  • Loading branch information
fabpot committed Aug 9, 2020
2 parents 6ceb165 + 6d1d911 commit 71da881
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Descriptor/TextDescriptor.php
Expand Up @@ -204,7 +204,7 @@ protected function describeApplication(Application $application, array $options
// calculate max. width based on available commands per namespace
$width = $this->getColumnWidth(\call_user_func_array('array_merge', array_map(function ($namespace) use ($commands) {
return array_intersect($namespace['commands'], array_keys($commands));
}, $namespaces)));
}, array_values($namespaces))));

if ($describedNamespace) {
$this->writeText(sprintf('<comment>Available commands for the "%s" namespace:</comment>', $describedNamespace), $options);
Expand Down

0 comments on commit 71da881

Please sign in to comment.