19 declare(strict_types=1);
41 private $component_decorator;
50 throw new LogicException(
'first argument and return value of closure must be type-hinted to \ILIAS\UI\Component\Component');
52 if ($this->component_decorator instanceof
Closure) {
53 $existing = $this->component_decorator;
54 $this->component_decorator =
static function (
Component $c) use ($component_decorator, $existing) :
Component {
55 $component = $existing(
$c);
57 return $component_decorator($component);
60 $this->component_decorator = $component_decorator;
71 return $this->component_decorator;
78 if (count($r->getParameters()) !== 1) {
81 $first_param_type = $r->getParameters()[0]->getType();
82 if ($first_param_type instanceof
ReflectionType && $first_param_type->getName() !== Component::class) {
85 $return_type = $r->getReturnType();
86 if ($return_type === null) {
89 if ($return_type->getName() !== Component::class) {
Interface isGlobalScreenItem.
addComponentDecorator(Closure $component_decorator)