1 | <?php |
||
11 | class AllowedInclude |
||
12 | { |
||
13 | /** @var string */ |
||
14 | protected $name; |
||
15 | |||
16 | /** @var IncludeInterface */ |
||
17 | protected $includeClass; |
||
18 | |||
19 | /** @var string|null */ |
||
20 | protected $internalName; |
||
21 | |||
22 | public function __construct(string $name, IncludeInterface $includeClass, ?string $internalName = null) |
||
28 | |||
29 | public static function relationship(string $name, ?string $internalName = null): Collection |
||
54 | |||
55 | public static function count(string $name, ?string $internalName = null): Collection |
||
61 | |||
62 | public function include(QueryBuilder $query): void |
||
66 | |||
67 | public function getName(): string |
||
71 | |||
72 | public function getInternalName(): string |
||
73 | { |
||
74 | return $this->internalName ?? $this->name; |
||
75 | } |
||
76 | |||
77 | public function isForInclude(string $includeName): bool |
||
81 | } |
||
82 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.