ResolvesCurrentUser::getUserProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace seregazhuk\PinterestBot\Api\Traits;
4
5
use seregazhuk\PinterestBot\Api\Providers\Core\Provider;
6
use seregazhuk\PinterestBot\Api\Providers\User;
7
use seregazhuk\PinterestBot\Api\ProvidersContainer;
8
9
/**
10
 * @property ProvidersContainer container
11
 */
12
trait ResolvesCurrentUser
13
{
14
    /**
15
     * @return string
16
     */
17
    protected function resolveCurrentUsername()
18
    {
19
        return $this->getUserProvider()->username();
0 ignored issues
show
Bug introduced by
The method username() does not exist on seregazhuk\PinterestBot\...Providers\Core\Provider. It seems like you code against a sub-type of seregazhuk\PinterestBot\...Providers\Core\Provider such as seregazhuk\PinterestBot\Api\Providers\User. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        return $this->getUserProvider()->/** @scrutinizer ignore-call */ username();
Loading history...
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    protected function resolveCurrentUserId()
26
    {
27
        return $this->getUserProvider()->id();
0 ignored issues
show
Bug introduced by
The method id() does not exist on seregazhuk\PinterestBot\...Providers\Core\Provider. It seems like you code against a sub-type of seregazhuk\PinterestBot\...Providers\Core\Provider such as seregazhuk\PinterestBot\Api\Providers\User. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        return $this->getUserProvider()->/** @scrutinizer ignore-call */ id();
Loading history...
28
    }
29
30
    /**
31
     * @return Provider|User
32
     */
33
    protected function getUserProvider()
34
    {
35
        return $this->container->getProvider('user');
36
    }
37
}
38