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.

AccessPropertyTest.php$4 ➔ cases()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 28
rs 9.472
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Tests\Innmind\Reflection\Visitor;
5
6
use Innmind\Reflection\{
7
    Visitor\AccessProperty,
8
    Exception\PropertyNotFound,
9
};
10
use Fixtures\Innmind\Reflection\Foo;
11
use PHPUnit\Framework\TestCase;
12
13
class AccessPropertyTest extends TestCase
14
{
15
    /**
16
     * @dataProvider cases
17
     */
18
    public function testAccessProperty($object, string $property)
19
    {
20
        $this->assertInstanceOf(
21
            \ReflectionProperty::class,
22
            (new AccessProperty)($object, $property)
23
        );
24
    }
25
26
    public function testThrowWhenPropertyNotFound()
27
    {
28
        $this->expectException(PropertyNotFound::class);
29
        $this->expectExceptionMessage('foo');
30
31
        (new AccessProperty)(new \stdClass, 'foo');
32
    }
33
34
    public function cases(): array
35
    {
36
        return [
37
            [
38
                new class {
39
                    public $foo;
40
                },
41
                'foo',
42
            ],
43
            [
44
                new class {
45
                    protected $foo;
46
                },
47
                'foo',
48
            ],
49
            [
50
                new class {
51
                    private $foo;
0 ignored issues
show
introduced by
The private property $foo is not used, and could be removed.
Loading history...
52
                },
53
                'foo',
54
            ],
55
            [
56
                new class extends Foo {},
57
                'someProperty',
58
            ],
59
            [
60
                new class extends Foo {},
61
                'inheritProtected',
62
            ],
63
        ];
64
    }
65
}
66