Me   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
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
use Polidog\Chatwork\Entity\User;
10
11
/**
12
 * Api /me.
13
 */
14
class Me
15
{
16
    /**
17
     * @var ClientInterface
18
     */
19
    private $client;
20
21
    /**
22
     * @var UserFactory
23
     */
24
    private $factory;
25
26
    /**
27
     * Me constructor.
28
     *
29
     * @param ClientInterface $client
30
     * @param UserFactory     $factory
31
     */
32
    public function __construct(ClientInterface $client, UserFactory $factory)
33
    {
34
        $this->client = $client;
35
        $this->factory = $factory;
36
    }
37
38
    /**
39
     * @return User
40
     */
41
    public function show(): User
42
    {
43
        return $this->factory->entity(
44
            $this->client->get('me')
45
        );
46
    }
47
}
48