16 private $on_load_code_binder =
null;
25 $clone->on_load_code_binder = $binder;
35 if ($current_binder ===
null) {
40 return $this->
withOnLoadCode(
function ($id) use ($current_binder, $binder) {
41 return $current_binder($id) .
"\n" . $binder($id);
50 return $this->on_load_code_binder;
60 $refl = new \ReflectionFunction($binder);
61 $args = array_map(
function ($arg) {
63 }, $refl->getParameters());
64 if (array(
"id") !== $args) {
65 throw new \InvalidArgumentException(
'Expected closure "$binder" to have exactly one argument "$id".');
An exception for terminatinating execution or to throw for unit testing.
Interface to be extended by components that have the possibility to bind to Javascript.
checkBinder(\Closure $binder)
withAdditionalOnLoadCode(\Closure $binder)
withOnLoadCode(\Closure $binder)