new ParamSpec, 'score' => new ParamSpec]; } /** * @return array */ public function props(Call $call, RenderContext $ctx): array { $id = (string) $call->param('id'); if ($id === '') { return ['level' => 'none']; } $score = (int) $call->param('score'); return ['id' => $id, 'score' => $score, 'level' => AnnotationLayout::assessmentLevel($score)]; } public function html(Call $call, RenderContext $ctx): string { $id = (string) $call->param('id'); return $id === '' ? HtmlAnnotationMarkup::unassessedMark() : (new HtmlAnnotationMarkup)->assessmentMark($id, (int) $call->param('score')); } }