8000 [Console] Input validation succeeds with required arguments missing · Issue #15505 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Console] Input validation succeeds with required arguments missing #15505
Closed
@nochso

Description

@nochso

This will validate without throwing an exception even with missing required arguments. It happens when there are enough optional arguments set. They kind of "make up" for missing required arguments.

Class Input will probably have to keep track of how many required arguments were set.

    /**
     * Validates the input.
     *
     * @throws \RuntimeException When not enough arguments are given
     */
    public function validate()
    {
        if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) {
            throw new \RuntimeException('Not enough arguments.');
        }
    }

Input.php Line 76

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0