Files
myep-team/src/Enum/QuestionType.php
T

23 lines
527 B
PHP

<?php
namespace App\Enum;
/**
* The kinds of question a questionnaire definition may use. Each maps to exactly one form field
* in QuestionnaireType; adding one means a case here and a line there, nothing more.
*/
enum QuestionType: string
{
case TEXT = 'text';
case TEXTAREA = 'textarea';
case CHOICE = 'choice';
case MULTI = 'multi';
case DATE = 'date';
case RATING = 'rating';
public function hasOptions(): bool
{
return self::CHOICE === $this || self::MULTI === $this;
}
}