Completed
Push — master ( 6e52f0...d9a404 )
by Alexandre
02:29
created

WebApplication::useImplicit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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
ccs 0
cts 3
cp 0
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Alexandre
5
 * Date: 30/12/2017
6
 * Time: 17:01
7
 */
8
9
namespace OAuth2OLD\Role\Client;
10
11
use OAuth2OLD\Role\Client\Type\ConfidentialClient;
12
13
14
/**
15
 * Class WebApplication
16
 * @package OAuth2\roles\clients
17
 *
18
 * @see https://tools.ietf.org/html/rfc6749#section-2.1
19
 *
20
 * Client Types
21
 *
22
 *    A web application is a confidential client running on a web
23
 * server.  Resource owners access the client via an HTML user
24
 * interface rendered in a user-agent on the device used by the
25
 * resource owner.  The client credentials as well as any access
26
 * token issued to the client are stored on the web server and are
27
 * not exposed to or accessible by the resource owner.
28
 */
29
class WebApplication extends ConfidentialClient
30
{
31
    /**
32
     * @var bool
33
     */
34
    private $useImplicit;
35
36
    public function __construct($identifier, array $redirectUris = null, bool $useImplicit = false)
37
    {
38
        parent::__construct($identifier, $redirectUris);
0 ignored issues
show
Bug introduced by
The call to OAuth2OLD\Role\Client\Re...edClient::__construct() has too few arguments starting with supportedScopes. ( Ignorable by Annotation )

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

38
        parent::/** @scrutinizer ignore-call */ 
39
                __construct($identifier, $redirectUris);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
39
        $this->useImplicit = $useImplicit;
40
    }
41
42
    function useImplicit(): bool
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
43
    {
44
        return $this->useImplicit;
45
    }
46
}