Completed
Push — 3.x ( e32815...7c4255 )
by Ryota
10:41 queued 09:27
created

Contacts   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A show() 0 6 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