• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

overblog / GraphQLBundle / 16147271162

08 Jul 2025 03:15PM UTC coverage: 98.368%. Remained the same
16147271162

Pull #1145

github

web-flow
Merge e7b45c8ce into 92771e1ee
Pull Request #1145: PhpStan for AliasedInterface.php

4339 of 4411 relevant lines covered (98.37%)

39.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/src/Relay/Connection/Output/DeprecatedPropertyPublicAccessTrait.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Overblog\GraphQLBundle\Relay\Connection\Output;
6

7
use function array_keys;
8
use function get_object_vars;
9
use function in_array;
10
use function sprintf;
11
use function trigger_error;
12
use function ucfirst;
13

14
use const E_USER_DEPRECATED;
15

16
/**
17
 * @internal
18
 */
19
trait DeprecatedPropertyPublicAccessTrait
20
{
21
    /**
22
     * @return mixed
23
     */
24
    public function __get(string $name)
25
    {
26
        return $this->accessProperty('get', $name);
1✔
27
    }
28

29
    /**
30
     * @param mixed $value
31
     *
32
     * @return mixed
33
     */
34
    public function __set(string $name, $value)
35
    {
36
        return $this->accessProperty('set', $name, $value);
2✔
37
    }
38

39
    /**
40
     * @param mixed|null $value
41
     *
42
     * @return array|null
43
     */
44
    private function accessProperty(string $type, string $name, $value = null)
45
    {
46
        if (in_array($name, array_keys(get_object_vars($this)))) {
3✔
47
            $method = $type.ucfirst($name);
2✔
48

49
            @trigger_error(
2✔
50
                sprintf(
2✔
51
                    '%sting directly property %s::$%s value is deprecated as of 0.12 and will be removed in 0.13. '.
52
                    'You should now use method %s::%s.',
53
                    ucfirst($type),
2✔
54
                    __CLASS__,
2✔
55
                    $name,
2✔
56
                    __CLASS__,
2✔
57
                    $method
2✔
58
                ),
59
                E_USER_DEPRECATED
2✔
60
            );
61

62
            return $this->$method($value);
2✔
63
        }
64

65
        if ('set' === $type) {
1✔
66
            $this->$name = $value;
1✔
67

68
            return null;
1✔
69
        } else {
70
            return $this->$name;
×
71
        }
72
    }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc