Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
closurewrapper.php
1<?php
2
4
5
7use Closure;
8
9final class ClosureWrapper extends Base
10{
14 private $closure;
15
20 public function __construct(Closure $closure)
21 {
22 $this->closure = $closure->bindTo($this, $this);
23 parent::__construct();
24 }
25
26 public function onBeforeAction(Event $event)
27 {
28 return call_user_func($this->closure, $event);
29 }
30
31 public function onAfterAction(Event $event)
32 {
33 return call_user_func($this->closure, $event);
34 }
35}