Completed
Push — master ( d9a404...9e6750 )
by Alexandre
02:12
created

ConfidentialClient::getPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Alexandre
5
 * Date: 07/01/2018
6
 * Time: 13:37
7
 */
8
9
namespace OAuth2\Roles\Clients;
10
11
/**
12
 * Class ClientPasswordType
13
 * @package OAuth2\Roles\Clients\Types
14
 *
15
 * @see https://tools.ietf.org/html/rfc6749#section-2.1
16
 *
17
 * Client Types
18
 *
19
 *     Clients capable of maintaining the confidentiality of their
20
 * credentials (e.g., client implemented on a secure server with
21
 * restricted access to the client credentials), or capable of secure
22
 * client authentication using other means.
23
 */
24
abstract class ConfidentialClient extends RegisteredClient implements ConfidentialClientInterface
25
{
26
    protected $password;
27
28
    public function __construct(string $identifier, string $password, ClientMetadata $metadata)
29
    {
30
        parent::__construct($identifier, $metadata);
31
        $this->password = $password;
32
    }
33
34
    /**
35
     * @return string
36
     */
37 1
    public function getPassword(): string
38
    {
39 1
        return $this->password;
40
    }
41
42
    public function hasCredentials(): bool
43
    {
44
        return true;
45
    }
46
47
    public function requireRedirectUri() : bool {
48
        return $this->isImplicitAllowed();
0 ignored issues
show
Bug introduced by
The method isImplicitAllowed() does not exist on OAuth2\Roles\Clients\ConfidentialClient. ( Ignorable by Annotation )

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

48
        return $this->/** @scrutinizer ignore-call */ isImplicitAllowed();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
49
    }
50
}