Issues (66)

src/ContainerFactory.php (1 issue)

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
Deprecated Code introduced by
The function React\EventLoop\Factory::create() has been deprecated: 1.2.0 See Loop::get() instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

23
        $loop = $loop ?? /** @scrutinizer ignore-deprecated */ Factory::create();

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.

Loading history...
24
        $container->instance(LoopInterface::class, $loop);
25
26
        return $container;
27
    }
28
29
}