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.

AbstractEmptyResourceTest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 41
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
getClass() 0 1 ?
getSyncAsync() 0 1 ?
A provideProperties() 0 11 2
A testProperties() 0 18 4
1
<?php
2
declare(strict_types=1);
3
4
namespace ApiClients\Tools\ResourceTestUtilities;
5
6
use ReflectionClass;
7
use Throwable;
8
use TypeError;
9
10
abstract class AbstractEmptyResourceTest extends TestCase
11
{
12
    abstract public function getSyncAsync(): string;
13
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
     * @param mixed $args
31
     */
32
    public function testProperties($args)
33
    {
34
        $class = $this->getClass();
35
        $resource = new $class();
36
37
        foreach ($args as $arg) {
38
            list($method) = $arg;
39
40
            try {
41
                $resource->{$method}();
42
            } catch (TypeError $e) {
43
                self::assertTrue(true);
44
                continue;
45
            } catch (Throwable $t) {
46
                self::fail('Should have thrown a TypeError instead of a ' . get_class($t));
47
            }
48
        }
49
    }
50
}
51