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.
Completed
Push — master ( ce99bb...731744 )
by Cees-Jan
05:08
created

AbstractEmptyResourceTest::provideProperties()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 9
cp 0
rs 9.4285
c 0
b 0
f 0
nc 2
cc 2
eloc 6
nop 0
crap 6
1
<?php
2
declare(strict_types=1);
3
4
namespace ApiClients\Tools\ResourceTestUtilities;
5
6
use phpDocumentor\Reflection\DocBlock;
7
use ReflectionClass;
8
use Throwable;
9
use TypeError;
10
11
abstract class AbstractEmptyResourceTest extends TestCase
12
{
13
    abstract public function getSyncAsync(): string;
14
    abstract public function getClass(): string;
15
16
    public function provideProperties(): array
17
    {
18
        $yield = [];
19
        $class = new ReflectionClass($this->getClass());
20
21
        foreach ($class->getMethods() as $method) {
22
            $yield[] = [$method->getName()];
0 ignored issues
show
Bug introduced by
Consider using $method->name. There is an issue with getName() and APC-enabled PHP versions.
Loading history...
23
        }
24
25
        return [[$yield]];
26
    }
27
28
    /**
29
     * @dataProvider provideProperties
30
     */
31
    public function testProperties($args)
32
    {
33
        $class = $this->getClass();
34
        $resource = new $class();
35
36
        foreach ($args as $arg) {
37
            list ($method) = $arg;
38
39
            try {
40
                $resource->{$method}();
41
            } catch (TypeError $e) {
42
                self::assertTrue(true);
43
                continue;
44
            } catch (Throwable $t) {
45
                self::fail('Should have thrown a TypeError instead of a ' . get_class($t));
46
            }
47
        }
48
    }
49
}
50