eko/certificationy — pull request #17 by cleentfaar (2014-06-17 23:55:00+00:00)
Title: Multiple choice and phpdoc fixes

Thought I'd contribute some more while I'm at it.

This PR gives ``Question`` instances a nice flag to check if they are multiple choice, i.e. if multiple answers are found with ``$answer->isCorrect() === true``. The first use case I've added is to show a hint to the user whether he/she can use multiple answers or not:

![schermafbeelding 2014-06-18 om 01 45 02](https://cloud.githubusercontent.com/assets/795661/3308225/721b5324-f679-11e3-8d9d-62ba32cd8e32.png)

By default the option is set to ``true`` (showing the hint between the question and answers). If it is, it allows the ``QuestionSet``'s ``$multiSelect`` to be depend on the value from ``$question->isMultipleChoice()``, giving the user added validation when answering; if the question is s not multiple-choice and the user enters multiple answers (comma-separated), he/she gets a nice warning and has to try again. On the other hand, if the hint is disabled multiple-choice answers are always allowed and single answers are silently converted into arrays (this is the original scenario).

The ``number`` option you have for the ``StartCommand`` had the mode ``InputOption::VALUE_OPTIONAL``, which didn't really seem right to me, when would you want users to type: ``certicationy start --number`` (without an actual value for the number)? I changed that to be ``VALUE_REQUIRED``, the default is still 20, but if users try to enter without a value they get an error, which is better imo.

As far as the phpdocs go, I just fixed them using Symfony CS fixer and some personal preferences; I prefer sticking with the natural ``bool`` and ``int`` hints, and since Symfony does as well, I think you should do the same in this tool, as it implies certification for Symfony.

Finally I added a testcase to test the new ``isMultipleChoice`` method.

Tell me what you think, happy to modify.