1 <?php declare(strict_types=1);
24 private $component_decorator;
35 throw new LogicException(
'first argument and return value of closure must be type-hinted to \ILIAS\UI\Component\Component');
37 if ($this->component_decorator instanceof
Closure) {
38 $existing = $this->component_decorator;
39 $this->component_decorator =
static function (
Component $c) use ($component_decorator, $existing) :
Component {
40 $component = $existing(
$c);
42 return $component_decorator($component);
45 $this->component_decorator = $component_decorator;
57 return $this->component_decorator;
65 if (count($r->getParameters()) !== 1) {
68 $first_param_type = $r->getParameters()[0]->getType();
69 if ($first_param_type instanceof
ReflectionType && $first_param_type->getName() !== Component::class) {
72 $return_type = $r->getReturnType();
73 if ($return_type === null) {
76 if ($return_type->getName() !== Component::class) {
81 }
catch (\Throwable
$i) {
Interface isGlobalScreenItem.
addComponentDecorator(Closure $component_decorator)