public function setRequired($required)
    {
        if (is_bool($required) === true) {
            $this->required = $required;
        } else {
            $msg = "The 'required' argument must be a boolean value, '" . gettype($required) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setRequired($required)
    {
        if (is_bool($required) === true) {
            $this->required = $required;
        } else {
            $msg = "The 'required' argument must be a boolean value, '" . gettype($required) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setRequired ( $ required ) { if ( is_bool ( $ required ) === true ) { $ this -> required = $ required ; } else { $ msg = "The 'required' argument must be a boolean value, '" . gettype ( $ required ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set whether a choice is required to be selected by the candidate.

@param boolean $required
@throws \InvalidArgumentException If $required is not a boolean value.
Set whether a choice is required to be selected by the candidate .