ZendeskApiClientFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
/**
3
 * MtZendeskApi - ZF2 module wrapper around Zendesk PHP SDK
4
 *
5
 * @link      http://github.com/mtymek/MtZendeskApi
6
 * @copyright Copyright (c) 2014 Mateusz Tymek
7
 * @license   BSD 2-Clause
8
 */
9
10
namespace MtZendeskApi\Factory;
11
12
use Interop\Container\ContainerInterface;
13
use Zendesk\API\Client;
14
15
class ZendeskApiClientFactory
16
{
17
    public function __invoke(ContainerInterface $container)
18
    {
19
        $config = $container->get('config');
20
        $client = new Client($config['zendesk']['subdomain'], $config['zendesk']['username']);
21
        $client->setAuth('token', $config['zendesk']['token']);
22
        return $client;
23
    }
24
}
25