1<?
php declare(strict_types=1);
23 private $symbol_decorator;
32 throw new LogicException(
'first argument of closure must be type-hinted to \ILIAS\UI\Component\Symbol\Symbol');
34 if ($this->symbol_decorator instanceof Closure) {
35 $existing = $this->symbol_decorator;
36 $this->symbol_decorator =
static function (
Symbol $c) use ($symbol_decorator, $existing) :
Symbol {
37 $component = $existing(
$c);
39 return $symbol_decorator($component);
42 $this->symbol_decorator = $symbol_decorator;
53 return $this->symbol_decorator;
59 $r =
new ReflectionFunction(
$c);
60 if (count($r->getParameters()) !== 1) {
63 $first_param_type = $r->getParameters()[0]->getType();
64 if ($first_param_type instanceof ReflectionType && $first_param_type->getName() !== Symbol::class) {
67 $return_type = $r->getReturnType();
68 if ($return_type ===
null) {
71 if ($return_type->getName() !== Symbol::class) {
76 }
catch (\Throwable
$i) {
An exception for terminatinating execution or to throw for unit testing.
Interface hasSymbol Methods for Entries with Symbols.
A component is the most general form of an entity in the UI.
trait SymbolDecoratorTrait
addSymbolDecorator(Closure $symbol_decorator)