Skip to content

Conversation

@2colours
Copy link

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead

This is the most banal implementation imaginable. It's mainly meant to raise awareness of the issue.

@shehi
Copy link
Contributor

shehi commented Dec 12, 2025

The first half of this method has a supposition that $args is not empty. Just put all of it inside if ($subCommand !== null) condition. Refactor the remainder of the first half of the method accordingly by getting rid of unnecessary checks against null-pointer.

If $subCommand is null, the second half of the method kicks in.

In a nutshell, this method checks against subcommands, if any exist, responds to them. Otherwise it responds to the main listener (afai understand).

As you are at it, please also fix L257: It's ridiculous to check against one variable and prepend another even though their values are the same.

@2colours
Copy link
Author

Honestly, I would only do more than the bare minimum if this whole component got extracted and stopped being seen de facto deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants