ZendeskApiClientFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 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