ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
DeferredCallable.php
Go to the documentation of this file.
1 <?php
10 namespace Slim;
11 
12 use Closure;
14 
16 {
18 
19  private $callable;
21  private $container;
22 
28  public function __construct($callable, ContainerInterface $container = null)
29  {
30  $this->callable = $callable;
31  $this->container = $container;
32  }
33 
34  public function __invoke()
35  {
36  $callable = $this->resolveCallable($this->callable);
37  if ($callable instanceof Closure) {
38  $callable = $callable->bindTo($this->container);
39  }
40 
41  $args = func_get_args();
42 
43  return call_user_func_array($callable, $args);
44  }
45 }
$container
Definition: wac.php:13
Describes the interface of a container that exposes methods to read its entries.
Slim Framework (https://slimframework.com)
Definition: App.php:9
__construct($callable, ContainerInterface $container=null)
DeferredMiddleware constructor.