ClientCredentialsOnlyTrait::getDefaultScopes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Stevenmaguire\OAuth2\Client\Tool;
4
5
use League\OAuth2\Client\Token\AccessToken;
6
use Stevenmaguire\OAuth2\Client\Provider\Exception\ProviderConfigurationException;
7
8
trait ClientCredentialsOnlyTrait
9
{
10
    /**
11
     * Get authorization url to begin OAuth flow
12
     *
13
     * @return string
14
     */
15 4
    public function getBaseAuthorizationUrl()
16
    {
17 4
        throw ProviderConfigurationException::clientCredentialsOnly();
18
    }
19
20
    /**
21
     * Get the default scopes used by this provider.
22
     *
23
     * This should not be a complete list of all scopes, but the minimum
24
     * required for the provider user interface!
25
     *
26
     * @return array
27
     * @codeCoverageIgnore
28
     */
29
    protected function getDefaultScopes()
30
    {
31
        return [];
32
    }
33
34
    /**
35
     * Get provider url to fetch user details
36
     *
37
     * @param  AccessToken $token
38
     *
39
     * @return string
40
     */
41 2
    public function getResourceOwnerDetailsUrl(AccessToken $token)
0 ignored issues
show
Unused Code introduced by
The parameter $token is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
    {
43 2
        throw ProviderConfigurationException::clientCredentialsOnly();
44
    }
45
46
    /**
47
     * Generate a user object from a successful user details request.
48
     *
49
     * @param object $response
50
     * @param AccessToken $token
51
     * @return YelpResourceOwner
52
     * @codeCoverageIgnore
53
     */
54
    protected function createResourceOwner(array $response, AccessToken $token)
0 ignored issues
show
Unused Code introduced by
The parameter $response is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $token is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
55
    {
56
        throw ProviderConfigurationException::clientCredentialsOnly();
57
    }
58
}
59