Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

WendellAdriel
Copy link
Member

This PR adds the feature to configure required parameters for the commands extending the CommandController.

By default an empty array will be returned from the CommandController for backwards compatibility:

/**
 * The list of parameters required by the command.
 *
 * @return array<int, string>
 */
public function required(): array
{
    return [];
}

To define the required parameters for a command, developers should only implement the required method to return the list of parameters that should be required.

When running a command without any of the required parameters, an error message will be shown listing the required parameters that are missing.

@JustSteveKing JustSteveKing merged commit 7ccff45 into main May 20, 2023
@WendellAdriel WendellAdriel deleted the feature/required-parameters branch May 25, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants