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

brick / orm / 23255296146

18 Mar 2026 04:24PM UTC coverage: 47.104%. Remained the same
23255296146

push

github

BenMorel
Avoid \Exception that somehow confuses ECS

1 of 5 new or added lines in 1 file covered. (20.0%)

402 existing lines in 24 files now uncovered.

553 of 1174 relevant lines covered (47.1%)

10.6 hits per line

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

0.0
/src/ProxyTemplate.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace PROXY_NAMESPACE;
6

7
use Brick\ORM\Exception\EntityNotFoundException;
8
use Brick\ORM\Gateway;
9
use Brick\ORM\Proxy;
10

11
use IMPORTS;
12

13
/**
14
 * Proxy for CLASS_NAME entities.
15
 * This class is generated automatically. Please do not edit.
16
 */
17
class CLASS_NAMEProxy extends CLASS_NAME implements Proxy
18
{
19
    private const __NON_ID_PROPERTIES = [NON_ID_PROPS];
20

21
    private Gateway $__gateway;
22

23
    private array $__identity;
24

25
    private array $__scalarIdentity;
26

27
    private bool $__isInitialized = false;
28

29
    /**
30
     * Class constructor.
31
     *
32
     * @param Gateway              $gateway        The gateway.
33
     * @param array<string, mixed> $identity       The identity, as a map of property name to value.
34
     * @param list<int|string>     $scalarIdentity The identity, as a list of scalar values.
35
     */
36
    public function __construct(Gateway $gateway, array $identity, array $scalarIdentity)
37
    {
UNCOV
38
        $this->__gateway = $gateway;
×
UNCOV
39
        $this->__identity = $identity;
×
UNCOV
40
        $this->__scalarIdentity = $scalarIdentity;
×
41

42
        foreach ($identity as $prop => $value) {
×
43
            $this->{$prop} = $value;
×
44
        }
45

46
        unset($UNSET_NON_ID_PROPS);
×
47
    }
48

49
    public function __get(string $name): mixed
50
    {
UNCOV
51
        if (! $this->__isInitialized) {
×
UNCOV
52
            $loadProps = [];
×
53

54
            foreach (self::__NON_ID_PROPERTIES as $prop) {
×
55
                if (! isset($this->{$prop})) { // exclude initialized properties
×
UNCOV
56
                    $loadProps[] = $prop;
×
57
                }
58
            }
59

UNCOV
60
            if ($loadProps) {
×
UNCOV
61
                $propValues = $this->__gateway->loadProps(CLASS_NAME::class, $this->__identity, $loadProps);
×
62

63
                if ($propValues === null) {
×
64
                    throw EntityNotFoundException::entityNotFound(CLASS_NAME::class, $this->__scalarIdentity);
×
65
                }
66

67
                foreach ($propValues as $prop => $value) {
×
UNCOV
68
                    $this->{$prop} = $value;
×
69
                }
70
            }
71

UNCOV
72
            $this->__isInitialized = true;
×
73
        }
74

75
        return $this->{$name};
×
76
    }
77
}
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