1 | <?php |
||
12 | class CallbackOnMissContainer extends AbstractContainerDecorator |
||
13 | { |
||
14 | /** |
||
15 | * @var callback A callback function |
||
16 | */ |
||
17 | private $callback; |
||
18 | |||
19 | /** |
||
20 | * @param ContainerInterface $container The container being decorated |
||
21 | * @param callable $callback A callback function to be executed if an item in the container doesn't exist |
||
22 | * |
||
23 | * @throws \InvalidArgumentException |
||
24 | */ |
||
25 | 2 | public function __construct(ContainerInterface $container, $callback) |
|
34 | |||
35 | 1 | public function get($id) |
|
43 | } |
||
44 |