{"action":"closed","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/15505","labels_url":"https://api.github.com/repos/symfony/symfony/issues/15505/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/15505/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/15505/events","html_url":"https://github.com/symfony/symfony/issues/15505","id":100191958,"number":15505,"title":"[Console] Input validation succeeds with required arguments missing","user":{"login":"nochso","id":6887618,"avatar_url":"https://avatars.githubusercontent.com/u/6887618?v=3","gravatar_id":"","url":"https://api.github.com/users/nochso","html_url":"https://github.com/nochso","followers_url":"https://api.github.com/users/nochso/followers","following_url":"https://api.github.com/users/nochso/following{/other_user}","gists_url":"https://api.github.com/users/nochso/gists{/gist_id}","starred_url":"https://api.github.com/users/nochso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nochso/subscriptions","organizations_url":"https://api.github.com/users/nochso/orgs","repos_url":"https://api.github.com/users/nochso/repos","events_url":"https://api.github.com/users/nochso/events{/privacy}","received_events_url":"https://api.github.com/users/nochso/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Console","name":"Console","color":"DDDDDD"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-10T23:40:33Z","updated_at":"2015-09-27T13:32:25Z","closed_at":"2015-09-27T13:32:25Z","body":"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.\r\n\r\nClass `Input` will probably have to keep track of how many required arguments were set.\r\n\r\n```php\r\n    /**\r\n     * Validates the input.\r\n     *\r\n     * @throws \\RuntimeException When not enough arguments are given\r\n     */\r\n    public function validate()\r\n    {\r\n        if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) {\r\n            throw new \\RuntimeException('Not enough arguments.');\r\n        }\r\n    }\r\n```\r\n[Input.php Line 76](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Input/Input.php#L76)"}}