Completed
Push — 3.x ( e32815...7c4255 )
by Ryota
09:26 queued 05:13
created

Contacts::show()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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