1 | <?php |
||
16 | abstract class Record |
||
17 | { |
||
18 | use NameWorksTrait; |
||
19 | use HasManagerRecordTrait; |
||
20 | |||
21 | protected $_name = null; |
||
22 | |||
23 | protected $_dbData = []; |
||
24 | protected $_helpers = []; |
||
25 | |||
26 | |||
27 | protected $_data; |
||
28 | |||
29 | 11 | public function &__get($name) |
|
37 | |||
38 | 10 | public function __set($name, $value) |
|
42 | |||
43 | 11 | public function __isset($name) |
|
47 | |||
48 | public function __unset($name) |
||
52 | |||
53 | |||
54 | /** |
||
55 | * Overloads Ucfirst() helper |
||
56 | * |
||
57 | * @param string $name |
||
58 | * @param array $arguments |
||
59 | * @return \Nip\Helpers\AbstractHelper|null |
||
60 | */ |
||
61 | public function __call($name, $arguments) |
||
70 | |||
71 | /** |
||
72 | * @param string $name |
||
73 | * @return \Nip\Helpers\AbstractHelper |
||
74 | */ |
||
75 | public function getHelper($name) |
||
79 | |||
80 | /** |
||
81 | * @return mixed |
||
82 | */ |
||
83 | public function getName() |
||
90 | |||
91 | /** |
||
92 | * @param mixed $name |
||
93 | */ |
||
94 | public function setName($name) |
||
98 | |||
99 | /** |
||
100 | * @param bool|array $data |
||
101 | */ |
||
102 | public function writeDBData($data = false) |
||
108 | |||
109 | /** |
||
110 | * @return array |
||
111 | */ |
||
112 | public function getDBData() |
||
116 | |||
117 | /** |
||
118 | * @return mixed |
||
119 | */ |
||
120 | 5 | public function getPrimaryKey() |
|
126 | |||
127 | |||
128 | /** |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function insert() |
||
141 | |||
142 | /** |
||
143 | * @return bool|\Nip\Database\Result |
||
144 | */ |
||
145 | public function update() |
||
150 | |||
151 | public function save() |
||
155 | |||
156 | public function saveRecord() |
||
160 | |||
161 | public function delete() |
||
165 | |||
166 | /** |
||
167 | * @return bool |
||
168 | */ |
||
169 | public function isInDB() |
||
174 | |||
175 | /** |
||
176 | * @return bool|false|Record |
||
177 | */ |
||
178 | public function exists() |
||
182 | |||
183 | /** |
||
184 | * @return string |
||
185 | */ |
||
186 | public function toJSON() |
||
190 | |||
191 | /** |
||
192 | * @return mixed |
||
193 | */ |
||
194 | public function toArray() |
||
199 | |||
200 | /** |
||
201 | * @return mixed |
||
202 | */ |
||
203 | public function toApiArray() |
||
208 | |||
209 | /** |
||
210 | * @return Record |
||
211 | */ |
||
212 | public function getCloneWithRelations() |
||
219 | |||
220 | /** |
||
221 | * @return Record |
||
222 | */ |
||
223 | public function getClone() |
||
232 | |||
233 | /** |
||
234 | * @param self $record |
||
235 | */ |
||
236 | public function updateDataFromRecord($record) |
||
243 | |||
244 | /** |
||
245 | * @param bool|array $data |
||
246 | */ |
||
247 | 1 | public function writeData($data = false) |
|
253 | |||
254 | /** |
||
255 | * Clone the relations records from a sibling |
||
256 | * @param self $from |
||
257 | * @return \Nip\Records\Traits\Relations\HasRelationsRecordTrait |
||
258 | */ |
||
259 | public function cloneRelations($from) |
||
263 | |||
264 | /** |
||
265 | * @return \Nip\Request |
||
266 | */ |
||
267 | protected function getRequest() |
||
271 | } |
||
272 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.