19declare(strict_types=1);
24use ReflectionFunction;
25use InvalidArgumentException;
33 private ?Closure $on_load_code_binder =
null;
42 $clone->on_load_code_binder = $binder;
52 if ($current_binder ===
null) {
65 return $this->on_load_code_binder;
73 $refl =
new ReflectionFunction($binder);
74 $args = array_map(fn ($arg) => $arg->name, $refl->getParameters());
75 if (array(
"id") !== $args) {
76 throw new InvalidArgumentException(
'Expected closure "$binder" to have exactly one argument "$id".');
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Interface to be extended by components that have the possibility to bind to Javascript.
checkBinder(Closure $binder)
withAdditionalOnLoadCode(Closure $binder)
withOnLoadCode(Closure $binder)