UserEndpoint   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A me() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of datamolino client.
5
 *
6
 * (c) 2018 cwd.at GmbH <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cwd\Datamolino\Endpoints;
15
16
use Cwd\Datamolino\Model\User;
17
18
class UserEndpoint extends AbstractEndpoint
19
{
20
    const ENDPOINT = 'me';
21
22
    /**
23
     * @return User
24
     *
25
     * @throws \Http\Client\Exception
26
     */
27
    public function me(): User
28
    {
29
        // Result is different - denormalize by hand
30
        $data = $this->getClient()->call(null, null, self::ENDPOINT, null, false, 'GET');
31
32
        return $this->getClient()->denormalizeObject(User::class, [$data], false);
33
    }
34
}
35