5declare(strict_types=1);
7use \ILIAS\UI\Component\Input\Field;
8use \ILIAS\Refinery\Factory as Refinery;
35 throw new InvalidArgumentException(
36 'Numbers less than 0 are not allowed'
40 if (!in_array(
$status, self::$STATUS)) {
41 throw new InvalidArgumentException(
42 'No valid status: ' .
'\'$status\
''
58 throw new InvalidArgumentException(
59 'Numbers less than 0 are not allowed'
75 if (!in_array(
$status, self::$STATUS)) {
76 throw new InvalidArgumentException(
77 'No valid status: ' .
'\'$status\
''
92 ->numeric(
$lng->txt(
'prg_points'),
$lng->txt(
'prg_points_byline'))
94 ->withAdditionalTransformation($refinery->int()->isGreaterThan(-1))
98 $lng->txt(
'prg_status'),
99 $this->getStatusOptions(
$lng),
100 $lng->txt(
'prg_status_byline')
106 return $input->section(
111 $lng->txt(
'prg_assessment')
113 ->withAdditionalTransformation($refinery->custom()->transformation(function ($vals) {
115 (
int) $vals[
'points'],
116 (
int) $vals[
'status']
An exception for terminatinating execution or to throw for unit testing.
__construct(int $points, int $status)
getStatusOptions(ilLanguage $lng)
toFormInput(Field\Factory $input, \ilLanguage $lng, Refinery $refinery)