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

UserEndpoint::me()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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