ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
DeferredCallable.php
Go to the documentation of this file.
1<?php
10namespace Slim;
11
12use Closure;
14
16{
17 use CallableResolverAwareTrait;
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}
An exception for terminatinating execution or to throw for unit testing.
__construct($callable, ContainerInterface $container=null)
DeferredMiddleware constructor.
Describes the interface of a container that exposes methods to read its entries.
Describes the interface of a container that exposes methods to read its entries.
Slim Framework (https://slimframework.com)
Definition: App.php:9
$container
Definition: wac.php:13