GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

PayloadBuilderTest::testCanGetInstance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Gandung\JWT\Tests\Token;
4
5
use PHPUnit\Framework\TestCase;
6
use Gandung\JWT\Token\ClaimBuilder;
7
use Gandung\JWT\Token\PayloadBuilder;
8
9
/**
10
 * @author Paulus Gandung Prakosa <[email protected]>
11
 */
12
class PayloadBuilderTest extends TestCase
13
{
14
    public function testCanGetInstance()
15
    {
16
        $this->assertInstanceOf(PayloadBuilder::class, new PayloadBuilder(new ClaimBuilder));
0 ignored issues
show
Unused Code introduced by
The call to PayloadBuilder::__construct() has too many arguments starting with new \Gandung\JWT\Token\ClaimBuilder().

This check compares calls to functions or methods with their respective definitions. If the call has more 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.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
17
    }
18
19
    public function testCanBuildJWTPayloadAndGetItAfterwards()
20
    {
21
        $claim = (new ClaimBuilder)
22
            ->issuedBy('me')
23
            ->expireAt(new \DateTimeImmutable('@' . (time() + (3600 * 3))));
24
        $payload = (new PayloadBuilder)
25
            ->claim($claim)
26
            ->userData([
27
                'credentials' => [
28
                    'username' => 'me',
29
                    'password' => md5('me')
30
                ]
31
            ]);
32
        $data = $payload->getValue();
33
        $this->assertInternalType('array', $data);
34
        $this->assertNotEmpty($data);
35
    }
36
}
37