Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#536)
by
unknown
19:46
created

PropertyMetadata   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 24
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getPropertyValue() 0 3 1
A newReflectionMember() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Validator\Mapping;
6
7
use ReflectionException;
8
use ReflectionMethod;
9
use ReflectionProperty;
10
use Symfony\Component\Validator\Mapping\MemberMetadata;
11
12
/**
13
 * @author Timur Murtukov <[email protected]>
14
 */
15
class PropertyMetadata extends MemberMetadata
16
{
17 8
    public function __construct(string $name)
18
    {
19 8
        parent::__construct('anonymous', $name, $name);
20 8
    }
21
22
    /**
23
     * @param  $object
24
     * @return ReflectionMethod|ReflectionProperty
25
     * @throws ReflectionException
26
     */
27 8
    protected function newReflectionMember($object)
28
    {
29 8
        $member = new ReflectionProperty($object, $this->getName());
30 8
        $member->setAccessible(true);
31
32 8
        return $member;
33
    }
34
35
36 8
    public function getPropertyValue($object)
37
    {
38 8
        return $this->getReflectionMember($object)->getValue($object);
0 ignored issues
show
Bug introduced by
The method getValue() does not exist on ReflectionMethod. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
        return $this->getReflectionMember($object)->/** @scrutinizer ignore-call */ getValue($object);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
    }
40
}
41