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
Push — master ( 4e441b...b33a6d )
by Jérémiah
39s
created

DeprecatedPropertyPublicAccessTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 95.24%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 42
ccs 20
cts 21
cp 0.9524
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __get() 0 4 1
A __set() 0 4 1
A accessProperty() 0 29 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Relay\Connection\Output;
6
7
/**
8
 * @internal
9
 */
10
trait DeprecatedPropertyPublicAccessTrait
11
{
12 1
    public function __get($name)
13
    {
14 1
        return $this->accessProperty('get', $name);
15
    }
16
17 2
    public function __set($name, $value)
18
    {
19 2
        return $this->accessProperty('set', $name, $value);
20
    }
21
22 3
    private function accessProperty(string $type, string $name, $value = null)
23
    {
24 3
        if (\in_array($name, \array_keys(\get_object_vars($this)))) {
25 2
            $method = $type.\ucfirst($name);
26
27 2
            @\trigger_error(
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
28 2
                \sprintf(
29
                    '%sting directly property %s::$%s value is deprecated as of 0.12 and will be removed in 0.13. '.
30 2
                    'You should now use method %s::%s.',
31 2
                    \ucfirst($type),
32 2
                    __CLASS__,
33 2
                    $name,
34 2
                    __CLASS__,
35 2
                    $method
36
                ),
37 2
                \E_USER_DEPRECATED
38
            );
39
40 2
            return $this->$method($value);
41
        }
42
43 1
        if ('set' === $type) {
44 1
            $this->$name = $value;
45
46 1
            return null;
47
        } else {
48
            return $this->$name;
49
        }
50
    }
51
}
52