Slack   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
1
<?php
2
3
4
namespace PortlandLabs\Slackbot\Provider\Illuminate;
5
6
use CL\Slack\Serializer\PayloadResponseSerializer;
7
use CL\Slack\Serializer\PayloadSerializer;
8
use GuzzleHttp\Client as HttpClient;
9
use GuzzleHttp\ClientInterface;
10
use Illuminate\Container\Container;
11
use PortlandLabs\Slackbot\Slack\Api\Client as ApiClient;
12
use PortlandLabs\Slackbot\Slack\Api\Payload\Serializer;
13
use PortlandLabs\Slackbot\Slack\Api\Payload\ResponseSerializer;
14
use Symfony\Component\EventDispatcher\EventDispatcher;
15
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
16
17
class Slack implements Provider
18
{
19
20
    /**
21
     * Register this provider
22
     *
23
     * @param Container $container
24
     * @return void
25
     */
26
    public function register(Container $container)
27
    {
28
        $container->when(ApiClient::class)->needs('$token')->give(getenv('AUTH_TOKEN'));
29
        $container->when(ApiClient::class)->needs(PayloadSerializer::class)->give(Serializer::class);
30
        $container->when(ApiClient::class)->needs(PayloadResponseSerializer::class)->give(ResponseSerializer::class);
31
32
        $container->bind(ClientInterface::class, HttpClient::class);
33
        $container->bind(EventDispatcherInterface::class, EventDispatcher::class);
34
    }
35
}