Contacts   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A show() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Polidog\Chatwork\Api;
6
7
use Polidog\Chatwork\Client\ClientInterface;
8
use Polidog\Chatwork\Entity\Factory\UserFactory;
9
10
/**
11
 * Api Contacts.
12
 */
13
class Contacts
14
{
15
    /**
16
     * @var ClientInterface
17
     */
18
    private $client;
19
20
    /**
21
     * @var UserFactory
22
     */
23
    private $factory;
24
25
    /**
26
     * Contacts constructor.
27
     *
28
     * @param ClientInterface $client
29
     * @param UserFactory     $factory
30
     */
31
    public function __construct(ClientInterface $client, UserFactory $factory)
32
    {
33
        $this->client = $client;
34
        $this->factory = $factory;
35
    }
36
37
    /**
38
     * @return \Polidog\Chatwork\Entity\Collection\CollectionInterface
39
     */
40
    public function show()
41
    {
42
        return $this->factory->collection(
43
            $this->client->get('contacts')
44
        );
45
    }
46
}
47