Passed
Push — master ( af59f2...c344e1 )
by Alexandre
02:20
created

ClientSecretJwtAuthenticationMethod   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 10
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A support() 0 2 1
A authenticate() 0 2 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: GCC-MED
5
 * Date: 09/03/2018
6
 * Time: 16:58
7
 */
8
9
namespace OAuth2\ClientAuthentication;
10
11
12
use OAuth2\Roles\ClientInterface;
13
use Psr\Http\Message\ServerRequestInterface;
14
15
class ClientSecretJwtAuthenticationMethod implements ClientAuthenticationMethodInterface
16
{
17
18
    function support(ServerRequestInterface $request, array $requestData): 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...
19
    {
20
        // TODO: Implement support() method.
21
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return boolean. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
22
23
    function authenticate(ServerRequestInterface $request, array $requestData): ?ClientInterface
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...
24
    {
25
        // TODO: Implement authenticate() method.
26
    }
27
}