[Poll] Added variable num of options

not sure if it is the right way to do it
This commit is contained in:
Daniel
2020-11-09 17:43:10 +00:00
committed by Hugo Sales
parent 8543c8c68e
commit 0a1ea8749b
8 changed files with 158 additions and 50 deletions

View File

@@ -30,6 +30,13 @@ use Symfony\Component\Form\Form as SymfForm;
const MAX_OPT = 5;
class NewPollForm extends Form
{
/**
* Creates a form with variable num of fields
*
* @param int $optionNum
*
* @return SymfForm
*/
public static function make(int $optionNum): SymfForm
{
$optionNum = min(MAX_OPT,$optionNum);