Completed
Push — master ( d56647...5f1d83 )
by Kirill
11s
created

BotManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 28
rs 10
wmc 3
lcom 1
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultDriver() 0 4 1
A createGitterDriver() 0 4 1
A createSlackDriver() 0 4 1
1
<?php
2
/**
3
 * This file is part of GitterBot package.
4
 *
5
 * @author butschster <[email protected]>
6
 * @date 20.07.2016 17:08
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Domains;
12
13
use Illuminate\Support\Manager;
14
use Interfaces\Gitter\Client as GitterClient;
15
use Interfaces\Slack\Client as SlackClient;
16
17
/**
18
 * Class BotManager
19
 * @package Domains
20
 */
21
class BotManager extends Manager
22
{
23
    /**
24
     * Get the default driver name.
25
     *
26
     * @return string
27
     */
28
    public function getDefaultDriver()
29
    {
30
        return 'gitter';
31
    }
32
33
    /**
34
     * @return \Illuminate\Foundation\Application|mixed
35
     */
36
    public function createGitterDriver()
37
    {
38
        return new GitterClient($this->app['config']->get('gitter.token'));
39
    }
40
41
    /**
42
     * @return \Illuminate\Foundation\Application|mixed
43
     */
44
    public function createSlackDriver()
45
    {
46
        return new SlackClient($this->app['config']->get('slack.token'));
47
    }
48
}