1 | <?php |
||
13 | abstract class AbstractRelation implements RelationInterface |
||
14 | { |
||
15 | /** |
||
16 | * Indicates that relation commands must be executed prior to parent command. |
||
17 | */ |
||
18 | const LEADING_RELATION = false; |
||
19 | |||
20 | /** |
||
21 | * Indication that relation have been loaded. |
||
22 | * |
||
23 | * @var bool |
||
24 | */ |
||
25 | protected $loaded; |
||
26 | |||
27 | /** |
||
28 | * Parent record. Only read operations! |
||
29 | * |
||
30 | * @invisible |
||
31 | * @var RecordInterface |
||
32 | */ |
||
33 | protected $parent; |
||
34 | |||
35 | /** |
||
36 | * Class name relation points to. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $class; |
||
41 | |||
42 | /** |
||
43 | * Relation schema, defined when ORM being compiled. Check relation config to find out what |
||
44 | * schema producer been used for this relation accessor. |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $schema; |
||
49 | |||
50 | /** |
||
51 | * Related data. |
||
52 | * |
||
53 | * @invisible |
||
54 | * @var array |
||
55 | */ |
||
56 | protected $data = null; |
||
57 | |||
58 | /** |
||
59 | * Provides ability for lazy-loading model initialization and inner selects. |
||
60 | * |
||
61 | * @invisible |
||
62 | * @var ORMInterface |
||
63 | */ |
||
64 | protected $orm; |
||
65 | |||
66 | /** |
||
67 | * @param string $class Owner model class name. |
||
68 | * @param array $schema |
||
69 | * @param ORMInterface $orm |
||
70 | */ |
||
71 | public function __construct(string $class, array $schema, ORMInterface $orm) |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | public function isLeading(): bool |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function withContext( |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function getClass(): string |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function isLoaded(): bool |
||
117 | } |
Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.
To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.
The function can be called with either null or an array for the parameter
$needle
but will only accept an array as$haystack
.