Passed
Push — master ( ed94ae...15a67e )
by Ludwig
02:43
created

UserEndpoint   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1

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
    /**
21
     * @return User
22
     *
23
     * @throws \Http\Client\Exception
24
     */
25
    public function me(): User
26
    {
27
        // Result is different - denormalize by hand
28
        $data = $this->getClient()->call(null, null, 'me', null, false, 'GET');
29
30
        return $this->getClient()->denormalizeObject(User::class, [$data], false);
31
    }
32
}
33