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.
Passed
Push — master ( 2cdee4...626f1d )
by Cees-Jan
02:30 queued 16s
created

AsyncTestCase::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WyriHaximus\AsyncTestUtilities;
6
7
use PHPUnit\Framework\MockObject\Rule\InvokedCount;
8
use WyriHaximus\React\PHPUnit\RunTestsInFibersTrait;
9
use WyriHaximus\TestUtilities\TestCase;
10
11
abstract class AsyncTestCase extends TestCase
12
{
13
    use RunTestsInFibersTrait;
14
15
    private const INVOKE_ARRAY = ['__invoke'];
16
17
    /** @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.) */
18
    final protected function expectCallableExactly(int $amount): callable
19
    {
20
        return $this->getCallableMock(self::exactly($amount));
21
    }
22
23
    /** @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.) */
24
    final protected function expectCallableOnce(): callable
25
    {
26
        return $this->getCallableMock(self::once());
27
    }
28
29
    /** @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.) */
30
    final protected function expectCallableNever(): callable
31
    {
32
        return $this->getCallableMock(self::never());
33
    }
34
35
    /** @psalm-suppress InvalidReturnType */
36
    private function getCallableMock(InvokedCount $invokedCount): callable
37
    {
38
        $mock = $this->getMockBuilder(CallableStub::class)->onlyMethods(self::INVOKE_ARRAY)->getMock();
39
        /** @psalm-suppress InternalMethod */
40
        $mock
41
            ->expects($invokedCount)
42
            ->method('__invoke');
43
44
        /** @psalm-suppress InvalidReturnStatement */
45
        return $mock;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $mock returns the type PHPUnit\Framework\MockObject\MockObject which is incompatible with the type-hinted return callable.
Loading history...
46
    }
47
}
48