1 | <?php |
||
2 | namespace PortlandLabs\Slackbot; |
||
3 | |||
4 | use Psr\Container\ContainerInterface; |
||
5 | use React\EventLoop\Factory; |
||
6 | use React\EventLoop\LoopInterface; |
||
7 | |||
8 | class ContainerFactory |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * Create a new instance of the slackbot's container |
||
13 | * Use `$container->get(Bot::class)` to get an instance of the bot |
||
14 | * |
||
15 | * @param LoopInterface|null $loop |
||
16 | * @return ContainerInterface |
||
17 | */ |
||
18 | public static function illuminate(LoopInterface $loop = null): ContainerInterface |
||
19 | { |
||
20 | $container = new Container(); |
||
21 | $container->make(Provider\Illuminate::class)->register($container); |
||
22 | |||
23 | $loop = $loop ?? Factory::create(); |
||
0 ignored issues
–
show
|
|||
24 | $container->instance(LoopInterface::class, $loop); |
||
25 | |||
26 | return $container; |
||
27 | } |
||
28 | |||
29 | } |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.