· 6 years ago · May 26, 2019, 10:10 AM
1coolife@coolife:~/git-repos/gsoc/api$ ./vendor/bin/psalm --init . 1
2Config file created successfully. Please re-run psalm.
3coolife@coolife:~/git-repos/gsoc/api$ ./vendor/bin/psalm --init . 1
4A config file already exists in the current directory
5coolife@coolife:~/git-repos/gsoc/api$ ./vendor/bin/psalm .
6Scanning files...
7Analyzing files...
8
9ERROR: UndefinedClass - CRM/Api4/Page/AJAX.php:3:34 - Class or interface CRM_Core_Page does not exist
10class CRM_Api4_Page_AJAX extends CRM_Core_Page {
11
12
13ERROR: UndefinedClass - CRM/Api4/Page/Api4Explorer.php:3:42 - Class or interface CRM_Core_Page does not exist
14class CRM_Api4_Page_Api4Explorer extends CRM_Core_Page {
15
16
17ERROR: PropertyNotSetInConstructor - CRM/Api4/Upgrader.php:6:7 - Property CRM_Api4_Upgrader_Base::$ctx is not defined in constructor of CRM_Api4_Upgrader or in any methods called in the constructor
18class CRM_Api4_Upgrader extends CRM_Api4_Upgrader_Base {
19
20
21ERROR: MissingReturnType - CRM/Api4/Upgrader.php:14:19 - Method CRM_Api4_Upgrader::install does not have a return type, expecting void
22 public function install() {
23
24
25ERROR: UndefinedFunction - CRM/Api4/Upgrader.php:17:17 - Function civicrm_api3 does not exist
26 $v3Item = civicrm_api3('Navigation', 'get', [
27 'name' => 'API Explorer',
28 'return' => ['id', 'parent_id'],
29 'sequential' => 1,
30 'api.Navigation.create' => ['label' => ts("Api Explorer v3")],
31 ]);
32
33
34ERROR: MissingReturnType - CRM/Api4/Upgrader.php:59:19 - Method CRM_Api4_Upgrader::uninstall does not have a return type, expecting void
35 public function uninstall() {
36
37
38ERROR: UndefinedFunction - CRM/Api4/Upgrader.php:61:5 - Function civicrm_api3 does not exist
39 civicrm_api3('Navigation', 'get', [
40 'name' => 'Api Explorer v4',
41 'return' => ['id'],
42 'api.Navigation.delete' => [],
43 ]);
44
45
46ERROR: MixedInferredReturnType - CRM/Api4/Upgrader.php:85:14 - Could not verify return type 'true' for CRM_Api4_Upgrader::upgrade_1000
47 /**
48 * Example: Run a simple query when a module is enabled.
49 *
50 public function enable() {
51 CRM_Core_DAO::executeQuery('UPDATE foo SET is_active = 1 WHERE bar = "whiz"');
52 }
53
54 /**
55 * Example: Run a simple query when a module is disabled.
56 *
57 public function disable() {
58 CRM_Core_DAO::executeQuery('UPDATE foo SET is_active = 0 WHERE bar = "whiz"');
59 }
60
61 /**
62 * Example: Run a couple simple queries.
63 *
64 * @return TRUE on success
65 * @throws Exception
66 */
67 public function upgrade_1000() {
68 $this->ctx->log->info('Applying update 1000');
69 $domain = CRM_Core_Config::domainID();
70
71
72ERROR: UndefinedDocblockClass - CRM/Api4/Upgrader.php:89:5 - Cannot set properties of undefined docblock class CRM_Queue_TaskContext
73 $this->ctx->log->info('Applying update 1000');
74
75
76ERROR: MixedMethodCall - CRM/Api4/Upgrader.php:89:22 - Cannot determine the type of the object on the left hand side of this expression
77 $this->ctx->log->info('Applying update 1000');
78
79
80ERROR: UndefinedClass - CRM/Api4/Upgrader.php:90:15 - Class or interface CRM_Core_Config does not exist
81 $domain = CRM_Core_Config::domainID();
82
83
84ERROR: InvalidDocblock - CRM/Api4/Upgrader/Base.php:13:3 - varies, is not a valid type
85 /**
86 * @var varies, subclass of ttis
87 */
88 static $instance;
89
90
91ERROR: UndefinedDocblockClass - CRM/Api4/Upgrader/Base.php:16:11 - Docblock-defined class or interface CRM_Queue_TaskContext does not exist
92 /**
93 * @var CRM_Queue_TaskContext
94 */
95 protected $ctx;
96
97
98ERROR: PropertyNotSetInConstructor - CRM/Api4/Upgrader/Base.php:18:13 - Property CRM_Api4_Upgrader_Base::$ctx is not defined in constructor of CRM_Api4_Upgrader_Base or in any methods called in the constructor
99 protected $ctx;
100
101
102ERROR: InvalidDocblock - CRM/Api4/Upgrader/Base.php:23:3 - string, is not a valid type
103 /**
104 * @var string, eg 'com.example.myextension'
105 */
106 protected $extensionName;
107
108
109ERROR: InvalidDocblock - CRM/Api4/Upgrader/Base.php:28:3 - string, is not a valid type
110 /**
111 * @var string, full path to the extension's source tree
112 */
113 protected $extensionDir;
114
115
116ERROR: InvalidDocblock - CRM/Api4/Upgrader/Base.php:33:3 - array(revisionNumber) is not a valid type
117 /**
118 * @var array(revisionNumber) sorted numerically
119 */
120 private $revisions;
121
122
123ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:44:26 - Method CRM_Api4_Upgrader_Base::instance does not have a return type
124 static public function instance() {
125
126
127ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:65:26 - Method CRM_Api4_Upgrader_Base::_queueAdapter does not have a return type
128 static public function _queueAdapter() {
129
130
131ERROR: MixedAssignment - CRM/Api4/Upgrader/Base.php:66:5 - Cannot assign $instance to a mixed type
132 $instance = self::instance();
133
134
135ERROR: MixedPropertyAssignment - CRM/Api4/Upgrader/Base.php:68:5 - $instance of type mixed cannot be assigned to
136 $instance->ctx = array_shift($args);
137
138
139ERROR: MixedPropertyAssignment - CRM/Api4/Upgrader/Base.php:69:5 - $instance of type mixed cannot be assigned to
140 $instance->queue = $instance->ctx->queue;
141
142
143ERROR: MixedPropertyFetch - CRM/Api4/Upgrader/Base.php:69:24 - Cannot fetch property on mixed var $instance
144 $instance->queue = $instance->ctx->queue;
145
146
147ERROR: MixedAssignment - CRM/Api4/Upgrader/Base.php:70:5 - Cannot assign $method to a mixed type
148 $method = array_shift($args);
149
150
151ERROR: MixedArgumentTypeCoercion - CRM/Api4/Upgrader/Base.php:71:55 - Argument 2 of call_user_func_array expects array<int, mixed>, parent type array<array-key, mixed> provided
152 return call_user_func_array([$instance, $method], $args);
153
154
155ERROR: MissingParamType - CRM/Api4/Upgrader/Base.php:74:31 - Parameter $extensionName has no provided type
156 public function __construct($extensionName, $extensionDir) {
157
158
159ERROR: MissingParamType - CRM/Api4/Upgrader/Base.php:74:47 - Parameter $extensionDir has no provided type
160 public function __construct($extensionName, $extensionDir) {
161
162
163ERROR: MixedOperand - CRM/Api4/Upgrader/Base.php:88:17 - Left operand cannot be mixed
164 $xml_file = $this->extensionDir . '/' . $relativePath;
165
166
167ERROR: MixedInferredReturnType - CRM/Api4/Upgrader/Base.php:97:14 - Could not verify return type 'bool' for CRM_Api4_Upgrader_Base::executeCustomDataFileByAbsPath
168 /**
169 * Run a CustomData file
170 *
171 * @param string $xml_file the CustomData XML file path (absolute path)
172 *
173 * @return bool
174 */
175 protected static function executeCustomDataFileByAbsPath($xml_file) {
176 $import = new CRM_Utils_Migrate_Import();
177 $import->run($xml_file);
178 return TRUE;
179 }
180
181
182ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:100:19 - Class or interface CRM_Utils_Migrate_Import does not exist
183 $import = new CRM_Utils_Migrate_Import();
184
185
186ERROR: MixedInferredReturnType - CRM/Api4/Upgrader/Base.php:110:14 - Could not verify return type 'bool' for CRM_Api4_Upgrader_Base::executeSqlFile
187 /**
188 * Run a SQL file.
189 *
190 * @param string $relativePath the SQL file path (relative to this extension's dir)
191 *
192 * @return bool
193 */
194 public function executeSqlFile($relativePath) {
195 CRM_Utils_File::sourceSQLFile(
196 CIVICRM_DSN,
197 $this->extensionDir . DIRECTORY_SEPARATOR . $relativePath
198 );
199 return TRUE;
200
201
202ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:113:5 - Class or interface CRM_Utils_File does not exist
203 CRM_Utils_File::sourceSQLFile(
204
205
206ERROR: MixedInferredReturnType - CRM/Api4/Upgrader/Base.php:124:14 - Could not verify return type 'bool' for CRM_Api4_Upgrader_Base::executeSqlTemplate
207 /**
208 * @param string $tplFile
209 * The SQL file path (relative to this extension's dir).
210 * Ex: "sql/mydata.mysql.tpl".
211 * @return bool
212 */
213 public function executeSqlTemplate($tplFile) {
214 // Assign multilingual variable to Smarty.
215 $upgrade = new CRM_Upgrade_Form();
216
217
218
219ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:128:20 - Class or interface CRM_Upgrade_Form does not exist
220 $upgrade = new CRM_Upgrade_Form();
221
222
223ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:146:19 - Method CRM_Api4_Upgrader_Base::executeSql does not have a return type
224 public function executeSql($query, $params = []) {
225
226
227ERROR: MissingParamType - CRM/Api4/Upgrader/Base.php:146:30 - Parameter $query has no provided type
228 public function executeSql($query, $params = []) {
229
230
231ERROR: MissingParamType - CRM/Api4/Upgrader/Base.php:146:38 - Parameter $params has no provided type
232 public function executeSql($query, $params = []) {
233
234
235ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:148:5 - Class or interface CRM_Core_DAO does not exist
236 CRM_Core_DAO::executeQuery($query, $params);
237
238
239ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:161:19 - Method CRM_Api4_Upgrader_Base::addTask does not have a return type
240 public function addTask($title) {
241
242
243ERROR: MissingParamType - CRM/Api4/Upgrader/Base.php:161:27 - Parameter $title has no provided type
244 public function addTask($title) {
245
246
247ERROR: MixedAssignment - CRM/Api4/Upgrader/Base.php:163:5 - Cannot assign $title to a mixed type
248 $title = array_shift($args);
249
250
251ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:164:17 - Class or interface CRM_Queue_Task does not exist
252 $task = new CRM_Queue_Task(
253
254
255ERROR: MixedAssignment - CRM/Api4/Upgrader/Base.php:180:5 - Cannot assign $revisions to a mixed type
256 $revisions = $this->getRevisions();
257
258
259ERROR: MixedAssignment - CRM/Api4/Upgrader/Base.php:181:5 - Cannot assign $currentRevision to a mixed type
260 $currentRevision = $this->getCurrentRevision();
261
262
263ERROR: MixedArgument - CRM/Api4/Upgrader/Base.php:190:36 - Argument 1 of max cannot be mixed, expecting array<array-key, mixed>
264 return ($currentRevision < max($revisions));
265
266
267ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:196:19 - Method CRM_Api4_Upgrader_Base::enqueuePendingRevisions does not have a return type, expecting void
268 public function enqueuePendingRevisions(CRM_Queue_Queue $queue) {
269
270
271ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:196:43 - Class or interface CRM_Queue_Queue does not exist
272 public function enqueuePendingRevisions(CRM_Queue_Queue $queue) {
273
274
275ERROR: InvalidDocblock - CRM/Api4/Upgrader/Base.php:231:3 - Bracket must be preceded by “Closureâ€, “callable†or a valid @method name in docblock for CRM_Api4_Upgrader_Base::getRevisions
276 /**
277 * Get a list of revisions.
278 *
279 * @return array(revisionNumbers) sorted numerically
280 */
281 public function getRevisions() {
282
283
284ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:231:19 - Method CRM_Api4_Upgrader_Base::getRevisions does not have a return type, expecting array<array-key, mixed|string>
285 public function getRevisions() {
286
287
288ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:248:19 - Method CRM_Api4_Upgrader_Base::getCurrentRevision does not have a return type
289 public function getCurrentRevision() {
290
291
292ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:249:17 - Class or interface CRM_Core_BAO_Extension does not exist
293 $revision = CRM_Core_BAO_Extension::getSchemaVersion($this->extensionName);
294
295
296ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:256:20 - Method CRM_Api4_Upgrader_Base::getCurrentRevisionDeprecated does not have a return type
297 private function getCurrentRevisionDeprecated() {
298
299
300ERROR: MixedOperand - CRM/Api4/Upgrader/Base.php:257:12 - Left operand cannot be mixed
301 $key = $this->extensionName . ':version';
302
303
304ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:258:21 - Class or interface CRM_Core_BAO_Setting does not exist
305 if ($revision = CRM_Core_BAO_Setting::getItem('Extension', $key)) {
306
307
308ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:264:19 - Method CRM_Api4_Upgrader_Base::setCurrentRevision does not have a return type
309 public function setCurrentRevision($revision) {
310
311
312ERROR: MissingParamType - CRM/Api4/Upgrader/Base.php:264:38 - Parameter $revision has no provided type
313 public function setCurrentRevision($revision) {
314
315
316ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:265:5 - Class or interface CRM_Core_BAO_Extension does not exist
317 CRM_Core_BAO_Extension::setSchemaVersion($this->extensionName, $revision);
318
319
320ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:271:20 - Method CRM_Api4_Upgrader_Base::deleteDeprecatedRevision does not have a return type, expecting void
321 private function deleteDeprecatedRevision() {
322
323
324ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:273:22 - Class or interface CRM_Core_BAO_Setting does not exist
325 $setting = new CRM_Core_BAO_Setting();
326
327
328ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:285:19 - Method CRM_Api4_Upgrader_Base::onInstall does not have a return type, expecting void
329 public function onInstall() {
330
331
332ERROR: MixedOperand - CRM/Api4/Upgrader/Base.php:286:19 - Left operand cannot be mixed
333 $files = glob($this->extensionDir . '/sql/*_install.sql');
334
335
336ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:289:9 - Class or interface CRM_Utils_File does not exist
337 CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, $file);
338
339
340ERROR: MixedOperand - CRM/Api4/Upgrader/Base.php:292:19 - Left operand cannot be mixed
341 $files = glob($this->extensionDir . '/sql/*_install.mysql.tpl');
342
343
344ERROR: MixedOperand - CRM/Api4/Upgrader/Base.php:298:19 - Left operand cannot be mixed
345 $files = glob($this->extensionDir . '/xml/*_install.xml');
346
347
348ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:312:19 - Method CRM_Api4_Upgrader_Base::onPostInstall does not have a return type, expecting void
349 public function onPostInstall() {
350
351
352ERROR: MixedAssignment - CRM/Api4/Upgrader/Base.php:313:5 - Cannot assign $revisions to a mixed type
353 $revisions = $this->getRevisions();
354
355
356ERROR: MixedArgument - CRM/Api4/Upgrader/Base.php:315:37 - Argument 1 of max cannot be mixed, expecting array<array-key, mixed>
357 $this->setCurrentRevision(max($revisions));
358
359
360ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:325:19 - Method CRM_Api4_Upgrader_Base::onUninstall does not have a return type, expecting void
361 public function onUninstall() {
362
363
364ERROR: MixedOperand - CRM/Api4/Upgrader/Base.php:326:19 - Left operand cannot be mixed
365 $files = glob($this->extensionDir . '/sql/*_uninstall.mysql.tpl');
366
367
368ERROR: MixedOperand - CRM/Api4/Upgrader/Base.php:335:19 - Left operand cannot be mixed
369 $files = glob($this->extensionDir . '/sql/*_uninstall.sql');
370
371
372ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:338:9 - Class or interface CRM_Utils_File does not exist
373 CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, $file);
374
375
376ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:346:19 - Method CRM_Api4_Upgrader_Base::onEnable does not have a return type, expecting void
377 public function onEnable() {
378
379
380ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:356:19 - Method CRM_Api4_Upgrader_Base::onDisable does not have a return type, expecting void
381 public function onDisable() {
382
383
384ERROR: MissingReturnType - CRM/Api4/Upgrader/Base.php:363:19 - Method CRM_Api4_Upgrader_Base::onUpgrade does not have a return type
385 public function onUpgrade($op, CRM_Queue_Queue $queue = NULL) {
386
387
388ERROR: UndefinedClass - CRM/Api4/Upgrader/Base.php:363:34 - Class or interface CRM_Queue_Queue does not exist
389 public function onUpgrade($op, CRM_Queue_Queue $queue = NULL) {
390
391
392ERROR: MissingReturnType - Civi/Api4/Action/Address/Create.php:36:19 - Method Civi\Api4\Action\Address\Create::_run does not have a return type, expecting void
393 public function _run(Result $result) {
394
395
396ERROR: MissingReturnType - Civi/Api4/Action/Address/Update.php:36:19 - Method Civi\Api4\Action\Address\Update::_run does not have a return type, expecting void
397 public function _run(Result $result) {
398
399
400ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Campaign/Get.php:9:7 - Property Civi\Api4\Generic\Traits\IsCurrentTrait::$current is not defined in constructor of Civi\Api4\Action\Campaign\Get or in any methods called in the constructor
401class Get extends \Civi\Api4\Generic\DAOGetAction {
402
403
404ERROR: MissingReturnType - Civi/Api4/Action/Contact/Create.php:10:22 - Method Civi\Api4\Action\Contact\Create::fillDefaults does not have a return type, expecting void
405 protected function fillDefaults(&$params) {
406
407
408ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Contact/GetChecksum.php:22:13 - Property Civi\Api4\Action\Contact\GetChecksum::$contactId is not defined in constructor of Civi\Api4\Action\Contact\GetChecksum or in any methods called in the constructor
409 protected $contactId;
410
411
412ERROR: PossiblyNullPropertyAssignmentValue - Civi/Api4/Action/Contact/GetChecksum.php:31:20 - $this->ttl with non-nullable declared type 'int' cannot be assigned nullable type 'null'
413 protected $ttl = NULL;
414
415
416ERROR: MissingReturnType - Civi/Api4/Action/Contact/GetChecksum.php:36:19 - Method Civi\Api4\Action\Contact\GetChecksum::_run does not have a return type, expecting void
417 public function _run(Result $result) {
418
419
420ERROR: DocblockTypeContradiction - Civi/Api4/Action/Contact/GetChecksum.php:37:33 - string(0) does not contain int
421 $ttl = ($this->ttl === 0 || $this->ttl === '0') ? 'inf' : $this->ttl;
422
423
424ERROR: UndefinedClass - Civi/Api4/Action/Contact/GetChecksum.php:40:21 - Class or interface CRM_Contact_BAO_Contact_Utils does not exist
425 'checksum' => \CRM_Contact_BAO_Contact_Utils::generateChecksum($this->contactId, NULL, $ttl),
426
427
428ERROR: MixedInferredReturnType - Civi/Api4/Action/Contact/GetFields.php:8:22 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Action\Contact\GetFields::getRecords
429 protected function getRecords() {
430
431
432ERROR: UndefinedClass - Civi/Api4/Action/Contact/GetFields.php:12:37 - Class or interface CRM_Core_Permission does not exist
433 if ($this->checkPermissions && !\CRM_Core_Permission::check([$apiKeyPerms])) {
434
435
436ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Contact/ValidateChecksum.php:22:13 - Property Civi\Api4\Action\Contact\ValidateChecksum::$contactId is not defined in constructor of Civi\Api4\Action\Contact\ValidateChecksum or in any methods called in the constructor
437 protected $contactId;
438
439
440ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Contact/ValidateChecksum.php:30:13 - Property Civi\Api4\Action\Contact\ValidateChecksum::$checksum is not defined in constructor of Civi\Api4\Action\Contact\ValidateChecksum or in any methods called in the constructor
441 protected $checksum;
442
443
444ERROR: MissingReturnType - Civi/Api4/Action/Contact/ValidateChecksum.php:35:19 - Method Civi\Api4\Action\Contact\ValidateChecksum::_run does not have a return type, expecting void
445 public function _run(Result $result) {
446
447
448ERROR: UndefinedClass - Civi/Api4/Action/Contact/ValidateChecksum.php:37:18 - Class or interface CRM_Contact_BAO_Contact_Utils does not exist
449 'valid' => \CRM_Contact_BAO_Contact_Utils::validChecksum($this->contactId, $this->checksum),
450
451
452ERROR: MissingReturnType - Civi/Api4/Action/Contribution/Create.php:12:19 - Method Civi\Api4\Action\Contribution\Create::_run does not have a return type, expecting void
453 public function _run(Result $result) {
454
455
456ERROR: MixedInferredReturnType - Civi/Api4/Action/CustomValue/GetFields.php:14:22 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Action\CustomValue\GetFields::getRecords
457 protected function getRecords() {
458
459
460ERROR: UndefinedClass - Civi/Api4/Action/CustomValue/GetFields.php:17:17 - Class or interface Civi does not exist
461 $gatherer = \Civi::container()->get('spec_gatherer');
462
463
464ERROR: MixedInferredReturnType - Civi/Api4/Action/Entity/Get.php:26:22 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Action\Entity\Get::getRecords
465 protected function getRecords() {
466
467
468ERROR: UndefinedClass - Civi/Api4/Action/Entity/Get.php:28:14 - Class or interface CRM_Extension_System does not exist
469 foreach (\CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles() as $ext) {
470
471
472ERROR: MissingReturnType - Civi/Api4/Action/Entity/Get.php:58:20 - Method Civi\Api4\Action\Entity\Get::addCustomEntities does not have a return type, expecting void
473 private function addCustomEntities(&$entities) {
474
475
476ERROR: MissingParamType - Civi/Api4/Action/Entity/Get.php:58:39 - Parameter $entities has no provided type
477 private function addCustomEntities(&$entities) {
478
479
480ERROR: MixedAssignment - Civi/Api4/Action/Entity/Get.php:65:33 - Cannot assign $customEntity to a mixed type
481 foreach ($customEntities as $customEntity) {
482
483
484ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:66:32 - Cannot access array value on mixed variable $customEntity
485 $fieldName = 'Custom_' . $customEntity['name'];
486
487
488ERROR: MixedOperand - Civi/Api4/Action/Entity/Get.php:66:32 - Right operand cannot be mixed
489 $fieldName = 'Custom_' . $customEntity['name'];
490
491
492ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:69:26 - Cannot access array value on mixed variable $customEntity
493 'description' => $customEntity['title'] . ' custom group - extends ' . $customEntity['extends'],
494
495
496ERROR: MixedOperand - Civi/Api4/Action/Entity/Get.php:69:26 - Left operand cannot be mixed
497 'description' => $customEntity['title'] . ' custom group - extends ' . $customEntity['extends'],
498
499
500ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:69:80 - Cannot access array value on mixed variable $customEntity
501 'description' => $customEntity['title'] . ' custom group - extends ' . $customEntity['extends'],
502
503
504ERROR: MixedOperand - Civi/Api4/Action/Entity/Get.php:69:80 - Right operand cannot be mixed
505 'description' => $customEntity['title'] . ' custom group - extends ' . $customEntity['extends'],
506
507
508ERROR: MixedAssignment - Civi/Api4/Action/Entity/Get.php:72:9 - Cannot assign to a mixed type
509 $entities[$fieldName]['comment'] = $this->plainTextify($customEntity['help_pre']);
510
511
512ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:72:9 - Cannot access array value on mixed variable $entities
513 $entities[$fieldName]['comment'] = $this->plainTextify($customEntity['help_pre']);
514
515
516ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:72:64 - Cannot access array value on mixed variable $customEntity
517 $entities[$fieldName]['comment'] = $this->plainTextify($customEntity['help_pre']);
518
519
520ERROR: MixedOperand - Civi/Api4/Action/Entity/Get.php:75:63 - Left operand cannot be mixed
521 $pre = empty($entities[$fieldName]['comment']) ? '' : $entities[$fieldName]['comment'] . "\n\n";
522
523
524ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:75:63 - Cannot access array value on mixed variable $entities
525 $pre = empty($entities[$fieldName]['comment']) ? '' : $entities[$fieldName]['comment'] . "\n\n";
526
527
528ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:76:9 - Cannot access array value on mixed variable $entities
529 $entities[$fieldName]['comment'] = $pre . $this->plainTextify($customEntity['help_post']);
530
531
532ERROR: MixedOperand - Civi/Api4/Action/Entity/Get.php:76:51 - Right operand cannot be mixed
533 $entities[$fieldName]['comment'] = $pre . $this->plainTextify($customEntity['help_post']);
534
535
536ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:76:71 - Cannot access array value on mixed variable $customEntity
537 $entities[$fieldName]['comment'] = $pre . $this->plainTextify($customEntity['help_post']);
538
539
540ERROR: MissingParamType - Civi/Api4/Action/Entity/Get.php:87:33 - Parameter $input has no provided type
541 private function plainTextify($input) {
542
543
544ERROR: MixedArgument - Civi/Api4/Action/Entity/Get.php:88:42 - Argument 1 of strip_tags cannot be mixed, expecting string
545 return html_entity_decode(strip_tags($input), ENT_QUOTES | ENT_HTML5, 'UTF-8');
546
547
548ERROR: MissingReturnType - Civi/Api4/Action/Entity/Get.php:96:20 - Method Civi\Api4\Action\Entity\Get::addDocs does not have a return type, expecting void
549 private function addDocs(&$entity) {
550
551
552ERROR: MissingParamType - Civi/Api4/Action/Entity/Get.php:96:29 - Parameter $entity has no provided type
553 private function addDocs(&$entity) {
554
555
556ERROR: ArgumentTypeCoercion - Civi/Api4/Action/Entity/Get.php:97:40 - Argument 1 of ReflectionClass::__construct expects class-string<T>|object, parent type string provided
557 $reflection = new \ReflectionClass("\\Civi\\Api4\\" . $entity['name']);
558
559
560ERROR: MixedOperand - Civi/Api4/Action/Entity/Get.php:97:59 - Right operand cannot be mixed
561 $reflection = new \ReflectionClass("\\Civi\\Api4\\" . $entity['name']);
562
563
564ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:97:59 - Cannot access array value on mixed variable $entity
565 $reflection = new \ReflectionClass("\\Civi\\Api4\\" . $entity['name']);
566
567
568ERROR: MixedOperand - Civi/Api4/Action/Entity/Get.php:98:5 - Left operand cannot be mixed
569 $entity += ReflectionUtils::getCodeDocs($reflection);
570
571
572ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:99:11 - Cannot access array value on mixed variable $entity
573 unset($entity['package'], $entity['method']);
574
575
576ERROR: MixedArrayAccess - Civi/Api4/Action/Entity/Get.php:99:31 - Cannot access array value on mixed variable $entity
577 unset($entity['package'], $entity['method']);
578
579
580ERROR: MixedInferredReturnType - Civi/Api4/Action/Entity/GetLinks.php:12:19 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Action\Entity\GetLinks::getRecords
581 public function getRecords() {
582
583
584ERROR: UndefinedClass - Civi/Api4/Action/Entity/GetLinks.php:15:15 - Class or interface Civi does not exist
585 $schema = \Civi::container()->get('schema_map');
586
587
588ERROR: MissingReturnType - Civi/Api4/Action/Entity/GetLinks.php:36:19 - Method Civi\Api4\Action\Entity\GetLinks::fields does not have a return type, expecting array{0:array{name:string}, 1:array{name:string}, 2:array{name:string, data_type:string}}
589 public function fields() {
590
591
592ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Event/Get.php:9:7 - Property Civi\Api4\Generic\Traits\IsCurrentTrait::$current is not defined in constructor of Civi\Api4\Action\Event\Get or in any methods called in the constructor
593class Get extends \Civi\Api4\Generic\DAOGetAction {
594
595
596ERROR: MissingPropertyType - Civi/Api4/Action/GetActions.php:15:11 - Property Civi\Api4\Action\GetActions::$_actions does not have a declared type - consider array
597 private $_actions = [];
598
599
600ERROR: MissingPropertyType - Civi/Api4/Action/GetActions.php:17:11 - Property Civi\Api4\Action\GetActions::$_actionsToGet does not have a declared type - consider array<array-key, mixed>|null
601 private $_actionsToGet;
602
603
604ERROR: MixedInferredReturnType - Civi/Api4/Action/GetActions.php:19:22 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Action\GetActions::getRecords
605 protected function getRecords() {
606
607
608ERROR: ArgumentTypeCoercion - Civi/Api4/Action/GetActions.php:22:46 - Argument 1 of ReflectionClass::__construct expects class-string<T>|object, parent type string provided
609 $entityReflection = new \ReflectionClass('\Civi\Api4\\' . $this->_entityName);
610
611
612ERROR: MixedOperand - Civi/Api4/Action/GetActions.php:22:63 - Right operand cannot be mixed
613 $entityReflection = new \ReflectionClass('\Civi\Api4\\' . $this->_entityName);
614
615
616ERROR: MixedArgument - Civi/Api4/Action/GetActions.php:29:70 - Argument 1 of count cannot be mixed, expecting array<array-key, mixed>|Countable
617 if (!$this->_actionsToGet || count($this->_actionsToGet) > count($this->_actions)) {
618
619
620ERROR: UndefinedClass - Civi/Api4/Action/GetActions.php:31:16 - Class or interface CRM_Extension_System does not exist
621 foreach (\CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles() as $ext) {
622
623
624ERROR: MissingReturnType - Civi/Api4/Action/GetActions.php:43:20 - Method Civi\Api4\Action\GetActions::scanDir does not have a return type, expecting void
625 private function scanDir($dir) {
626
627
628ERROR: MissingParamType - Civi/Api4/Action/GetActions.php:43:28 - Parameter $dir has no provided type
629 private function scanDir($dir) {
630
631
632ERROR: MixedArgument - Civi/Api4/Action/GetActions.php:44:16 - Argument 1 of is_dir cannot be mixed, expecting string
633 if (is_dir($dir)) {
634
635
636ERROR: ArgumentTypeCoercion - Civi/Api4/Action/GetActions.php:49:45 - Argument 1 of ReflectionClass::__construct expects class-string<T>|object, parent type string provided
637 $actionClass = new \ReflectionClass('\\Civi\\Api4\\Action\\' . $this->_entityName . '\\' . $actionName);
638
639
640ERROR: MixedOperand - Civi/Api4/Action/GetActions.php:49:72 - Right operand cannot be mixed
641 $actionClass = new \ReflectionClass('\\Civi\\Api4\\Action\\' . $this->_entityName . '\\' . $actionName);
642
643
644ERROR: MissingReturnType - Civi/Api4/Action/GetActions.php:60:20 - Method Civi\Api4\Action\GetActions::loadAction does not have a return type, expecting void
645 private function loadAction($actionName) {
646
647
648ERROR: MissingParamType - Civi/Api4/Action/GetActions.php:60:31 - Parameter $actionName has no provided type
649 private function loadAction($actionName) {
650
651
652ERROR: MixedArrayOffset - Civi/Api4/Action/GetActions.php:62:18 - Cannot access value on variable $this->_actions using mixed offset
653 if (!isset($this->_actions[$actionName]) && (!$this->_actionsToGet || in_array($actionName, $this->_actionsToGet))) {
654
655
656ERROR: MixedArgument - Civi/Api4/Action/GetActions.php:62:99 - Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed>
657 if (!isset($this->_actions[$actionName]) && (!$this->_actionsToGet || in_array($actionName, $this->_actionsToGet))) {
658
659
660ERROR: RedundantConditionGivenDocblockType - Civi/Api4/Action/GetActions.php:64:13 - Found a redundant condition when evaluating docblock-defined type $action and trying to reconcile type 'Civi\Api4\Generic\AbstractAction' to object
661 if (is_object($action)) {
662
663
664ERROR: NullOperand - Civi/Api4/Action/GetActions.php:70:13 - Left operand cannot be null
665 $this->_actions[$actionName] += $actionInfo;
666
667
668ERROR: UndefinedClass - Civi/Api4/Action/GetActions.php:78:12 - Class or interface Civi\API\Exception\NotImplementedException does not exist
669 catch (NotImplementedException $e) {
670
671
672ERROR: MissingReturnType - Civi/Api4/Action/GetActions.php:82:19 - Method Civi\Api4\Action\GetActions::fields does not have a return type, expecting array{0:array{name:string, data_type:string}, 1:array{name:string, data_type:string}, 2:array{name:string, data_type:string}, 3:array{name:string, data_type:string}}
673 public function fields() {
674
675
676ERROR: MissingReturnType - Civi/Api4/Action/GroupContact/Create.php:32:19 - Method Civi\Api4\Action\GroupContact\Create::_run does not have a return type, expecting void
677 public function _run(Result $result) {
678
679
680ERROR: MissingReturnType - Civi/Api4/Action/GroupContact/Update.php:32:19 - Method Civi\Api4\Action\GroupContact\Update::_run does not have a return type, expecting void
681 public function _run(Result $result) {
682
683
684ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Relationship/Get.php:9:7 - Property Civi\Api4\Generic\Traits\IsCurrentTrait::$current is not defined in constructor of Civi\Api4\Action\Relationship\Get or in any methods called in the constructor
685class Get extends \Civi\Api4\Generic\DAOGetAction {
686
687
688ERROR: InvalidDocblock - Civi/Api4/Action/Setting/AbstractSettingAction.php:13:1 - getDomainId is not a valid method in docblock for Civi\Api4\Action\Setting\AbstractSettingAction
689/**
690 * Base class for setting actions.
691 *
692 * @method int getDomainId
693 * @method $this setDomainId(int $domainId)
694 */
695abstract class AbstractSettingAction extends \Civi\Api4\Generic\AbstractAction {
696
697
698ERROR: MissingReturnType - Civi/Api4/Action/Setting/AbstractSettingAction.php:29:19 - Method Civi\Api4\Action\Setting\AbstractSettingAction::_run does not have a return type, expecting void
699 public function _run(Result $result) {
700
701
702ERROR: PossiblyInvalidIterator - Civi/Api4/Action/Setting/AbstractSettingAction.php:32:14 - Cannot iterate over int
703 foreach ($this->domainId as $domain) {
704
705
706ERROR: MixedInferredReturnType - Civi/Api4/Action/Setting/AbstractSettingAction.php:45:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Action\Setting\AbstractSettingAction::validateSettings
707 /**
708 * Checks that really ought to be taken care of by Civi::settings
709 *
710 * @param int $domain
711 * @return array
712 * @throws \API_Exception
713 */
714 protected function validateSettings($domain) {
715 $meta = \Civi\Core\SettingsMetadata::getMetadata([], $domain);
716
717
718ERROR: UndefinedClass - Civi/Api4/Action/Setting/AbstractSettingAction.php:49:13 - Class or interface Civi\Core\SettingsMetadata does not exist
719 $meta = \Civi\Core\SettingsMetadata::getMetadata([], $domain);
720
721
722ERROR: MissingReturnType - Civi/Api4/Action/Setting/AbstractSettingAction.php:63:22 - Method Civi\Api4\Action\Setting\AbstractSettingAction::findDomains does not have a return type, expecting void
723 protected function findDomains() {
724
725
726ERROR: UndefinedClass - Civi/Api4/Action/Setting/AbstractSettingAction.php:72:19 - Class or interface API_Exception does not exist
727 throw new \API_Exception('Invalid domain id: ' . implode(', ', $invalid));
728
729
730ERROR: UndefinedClass - Civi/Api4/Action/Setting/AbstractSettingAction.php:76:26 - Class or interface CRM_Core_Config does not exist
731 $this->domainId = [\CRM_Core_Config::domainID()];
732
733
734ERROR: InvalidDocblock - Civi/Api4/Action/Setting/Get.php:13:1 - getSelect is not a valid method in docblock for Civi\Api4\Action\Setting\Get
735/**
736 * Get the value of one or more CiviCRM settings.
737 *
738 * @method array getSelect
739 * @method $this addSelect(string $name)
740 * @method $this setSelect(array $select)
741 */
742class Get extends AbstractSettingAction {
743
744
745ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Setting/Get.php:13:7 - Property Civi\Api4\Action\Setting\AbstractSettingAction::$domainId is not defined in constructor of Civi\Api4\Action\Setting\Get or in any methods called in the constructor
746class Get extends AbstractSettingAction {
747
748
749ERROR: UndefinedDocblockClass - Civi/Api4/Action/Setting/Get.php:24:13 - Docblock-defined class or interface Civi\Core\SettingsBag does not exist
750 /**
751 * @param \Civi\Api4\Generic\Result $result
752 * @param \Civi\Core\SettingsBag $settingsBag
753 * @param array $meta
754 * @param int $domain
755 * @throws \Exception
756 */
757 protected function processSettings(Result $result, $settingsBag, $meta, $domain) {
758
759
760ERROR: MissingReturnType - Civi/Api4/Action/Setting/Get.php:29:22 - Method Civi\Api4\Action\Setting\Get::processSettings does not have a return type, expecting void
761 protected function processSettings(Result $result, $settingsBag, $meta, $domain) {
762
763
764ERROR: InvalidDocblock - Civi/Api4/Action/Setting/GetFields.php:10:1 - getDomainId is not a valid method in docblock for Civi\Api4\Action\Setting\GetFields
765/**
766 * Get information about CiviCRM settings.
767 *
768 * @method int getDomainId
769 * @method $this setDomainId(int $domainId)
770 */
771class GetFields extends \Civi\Api4\Generic\BasicGetFieldsAction {
772
773
774ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Setting/GetFields.php:17:13 - Property Civi\Api4\Action\Setting\GetFields::$domainId is not defined in constructor of Civi\Api4\Action\Setting\GetFields or in any methods called in the constructor
775 protected $domainId;
776
777
778ERROR: MixedInferredReturnType - Civi/Api4/Action/Setting/GetFields.php:19:22 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Action\Setting\GetFields::getRecords
779 protected function getRecords() {
780
781
782ERROR: UndefinedClass - Civi/Api4/Action/Setting/GetFields.php:24:12 - Class or interface Civi\Core\SettingsMetadata does not exist
783 return \Civi\Core\SettingsMetadata::getMetadata($filter, $this->domainId, $this->loadOptions);
784
785
786ERROR: MissingReturnType - Civi/Api4/Action/Setting/GetFields.php:27:19 - Method Civi\Api4\Action\Setting\GetFields::fields does not have a return type, expecting array{0:array{name:string, data_type:string}, 1:array{name:string, data_type:string}, 2:array{name:string, data_type:string}, 3:array{name:string, data_type:string}, 4:array{name:string, data_type:string}, 5:array{name:string, data_type:string}, 6:array{name:string, data_type:string}, 7:array{name:string, data_type:string}, 8:array{name:string, data_type:string}, 9:array{name:string, data_type:string}, 10:array{name:string, data_type:string}, 11:array{name:string, data_type:string}, 12:array{name:string, data_type:string}}
787 public function fields() {
788
789
790ERROR: InvalidDocblock - Civi/Api4/Action/Setting/Revert.php:13:1 - getSelect is not a valid method in docblock for Civi\Api4\Action\Setting\Revert
791/**
792 * Revert one or more CiviCRM settings to their default value.
793 *
794 * @method array getSelect
795 * @method $this addSelect(string $name)
796 * @method $this setSelect(array $select)
797 */
798class Revert extends AbstractSettingAction {
799
800
801ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Setting/Revert.php:13:7 - Property Civi\Api4\Action\Setting\AbstractSettingAction::$domainId is not defined in constructor of Civi\Api4\Action\Setting\Revert or in any methods called in the constructor
802class Revert extends AbstractSettingAction {
803
804
805ERROR: UndefinedDocblockClass - Civi/Api4/Action/Setting/Revert.php:25:13 - Docblock-defined class or interface Civi\Core\SettingsBag does not exist
806 /**
807 * @param \Civi\Api4\Generic\Result $result
808 * @param \Civi\Core\SettingsBag $settingsBag
809 * @param array $meta
810 * @param int $domain
811 * @throws \Exception
812 */
813 protected function processSettings(Result $result, $settingsBag, $meta, $domain) {
814
815
816ERROR: MissingReturnType - Civi/Api4/Action/Setting/Revert.php:30:22 - Method Civi\Api4\Action\Setting\Revert::processSettings does not have a return type, expecting void
817 protected function processSettings(Result $result, $settingsBag, $meta, $domain) {
818
819
820ERROR: InvalidDocblock - Civi/Api4/Action/Setting/Set.php:13:1 - getValues is not a valid method in docblock for Civi\Api4\Action\Setting\Set
821/**
822 * Set the value of one or more CiviCRM settings.
823 *
824 * @method array getValues
825 * @method $this setValues(array $value)
826 * @method $this addValue(string $name, mixed $value)
827 */
828class Set extends AbstractSettingAction {
829
830
831ERROR: PropertyNotSetInConstructor - Civi/Api4/Action/Setting/Set.php:13:7 - Property Civi\Api4\Action\Setting\AbstractSettingAction::$domainId is not defined in constructor of Civi\Api4\Action\Setting\Set or in any methods called in the constructor
832class Set extends AbstractSettingAction {
833
834
835ERROR: UndefinedDocblockClass - Civi/Api4/Action/Setting/Set.php:25:13 - Docblock-defined class or interface Civi\Core\SettingsBag does not exist
836 /**
837 * @param \Civi\Api4\Generic\Result $result
838 * @param \Civi\Core\SettingsBag $settingsBag
839 * @param array $meta
840 * @param int $domain
841 * @throws \Exception
842 */
843 protected function processSettings(Result $result, $settingsBag, $meta, $domain) {
844
845
846ERROR: MissingReturnType - Civi/Api4/Action/Setting/Set.php:30:22 - Method Civi\Api4\Action\Setting\Set::processSettings does not have a return type, expecting void
847 protected function processSettings(Result $result, $settingsBag, $meta, $domain) {
848
849
850ERROR: MixedInferredReturnType - Civi/Api4/Action/System/Check.php:9:22 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Action\System\Check::getRecords
851 protected function getRecords() {
852
853
854ERROR: UndefinedClass - Civi/Api4/Action/System/Check.php:11:14 - Class or interface CRM_Utils_Check does not exist
855 foreach (\CRM_Utils_Check::checkAll() as $message) {
856
857
858ERROR: MissingReturnType - Civi/Api4/Action/System/Check.php:17:26 - Method Civi\Api4\Action\System\Check::fields does not have a return type
859 public static function fields() {
860
861
862ERROR: MixedArgument - Civi/Api4/Action/System/Check.php:53:36 - Argument 1 of array_combine cannot be mixed, expecting array<mixed, TKey>
863 'options' => array_combine(\CRM_Utils_Check::getSeverityList(), \CRM_Utils_Check::getSeverityList()),
864
865
866ERROR: UndefinedClass - Civi/Api4/Action/System/Check.php:53:36 - Class or interface CRM_Utils_Check does not exist
867 'options' => array_combine(\CRM_Utils_Check::getSeverityList(), \CRM_Utils_Check::getSeverityList()),
868
869
870ERROR: MixedArgument - Civi/Api4/Action/System/Check.php:53:73 - Argument 2 of array_combine cannot be mixed, expecting array<mixed, TValue>
871 'options' => array_combine(\CRM_Utils_Check::getSeverityList(), \CRM_Utils_Check::getSeverityList()),
872
873
874ERROR: UndefinedClass - Civi/Api4/Action/System/Check.php:60:22 - Class or interface CRM_Utils_Check does not exist
875 'options' => \CRM_Utils_Check::getSeverityList(),
876
877
878ERROR: InvalidDocblock - Civi/Api4/Action/System/Flush.php:12:1 - getTriggers is not a valid method in docblock for Civi\Api4\Action\System\Flush
879/**
880 * Clear CiviCRM caches, and optionally rebuild triggers and reset sessions.
881 *
882 * @method bool getTriggers
883 * @method $this setTriggers(bool $triggers)
884 * @method bool getSession
885 * @method $this setSession(bool $session)
886 */
887class Flush extends \Civi\Api4\Generic\AbstractAction {
888
889
890ERROR: MissingReturnType - Civi/Api4/Action/System/Flush.php:28:19 - Method Civi\Api4\Action\System\Flush::_run does not have a return type, expecting void
891 public function _run(\Civi\Api4\Generic\Result $result) {
892
893
894ERROR: UndefinedClass - Civi/Api4/Action/System/Flush.php:29:5 - Class or interface CRM_Core_Invoke does not exist
895 \CRM_Core_Invoke::rebuildMenuAndCaches($this->triggers, $this->session);
896
897
898ERROR: MissingReturnType - Civi/Api4/Contact.php:28:26 - Method Civi\Api4\Contact::getChecksum does not have a return type, expecting Civi\Api4\Action\Contact\GetChecksum
899 public static function getChecksum() {
900
901
902ERROR: MissingReturnType - Civi/Api4/Contact.php:33:26 - Method Civi\Api4\Contact::validateChecksum does not have a return type, expecting Civi\Api4\Action\Contact\ValidateChecksum
903 public static function validateChecksum() {
904
905
906ERROR: MixedInferredReturnType - Civi/Api4/CustomValue.php:71:26 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\CustomValue::permissions
907 public static function permissions() {
908
909
910ERROR: UndefinedClass - Civi/Api4/CustomValue.php:73:20 - Class or interface CRM_Core_Permission does not exist
911 $permissions = \CRM_Core_Permission::getEntityActionPermissions();
912
913
914ERROR: UndefinedClass - Civi/Api4/Event/GetSpecEvent.php:8:28 - Class or interface Symfony\Component\EventDispatcher\Event does not exist
915class GetSpecEvent extends BaseEvent {
916
917
918ERROR: UndefinedClass - Civi/Api4/Event/PostSelectQueryEvent.php:8:36 - Class or interface Symfony\Component\EventDispatcher\Event does not exist
919class PostSelectQueryEvent extends Event {
920
921
922ERROR: UndefinedClass - Civi/Api4/Event/SchemaMapBuildEvent.php:8:35 - Class or interface Symfony\Component\EventDispatcher\Event does not exist
923class SchemaMapBuildEvent extends BaseEvent {
924
925
926ERROR: MissingDependency - Civi/Api4/Event/Subscriber/ActivityPreCreationSubscriber.php:8:45 - Civi\Api4\Event\Subscriber\Generic\PreCreationSubscriber depends on class or interface symfony\component\eventdispatcher\eventsubscriberinterface that does not exist
927class ActivityPreCreationSubscriber extends Generic\PreCreationSubscriber {
928
929
930ERROR: UndefinedClass - Civi/Api4/Event/Subscriber/ActivitySchemaMapSubscriber.php:13:46 - Class or interface Symfony\Component\EventDispatcher\EventSubscriberInterface does not exist
931class ActivitySchemaMapSubscriber implements EventSubscriberInterface {
932
933
934ERROR: UndefinedClass - Civi/Api4/Event/Subscriber/ContactSchemaMapSubscriber.php:11:45 - Class or interface Symfony\Component\EventDispatcher\EventSubscriberInterface does not exist
935class ContactSchemaMapSubscriber implements EventSubscriberInterface {
936
937
938ERROR: MissingDependency - Civi/Api4/Event/Subscriber/CustomFieldPreCreationSubscriber.php:7:48 - Civi\Api4\Event\Subscriber\Generic\PreCreationSubscriber depends on class or interface symfony\component\eventdispatcher\eventsubscriberinterface that does not exist
939class CustomFieldPreCreationSubscriber extends Generic\PreCreationSubscriber {
940
941
942ERROR: MissingDependency - Civi/Api4/Event/Subscriber/CustomGroupPreCreationSubscriber.php:7:48 - Civi\Api4\Event\Subscriber\Generic\PreCreationSubscriber depends on class or interface symfony\component\eventdispatcher\eventsubscriberinterface that does not exist
943class CustomGroupPreCreationSubscriber extends Generic\PreCreationSubscriber {
944
945
946ERROR: UndefinedClass - Civi/Api4/Event/Subscriber/Generic/AbstractPrepareSubscriber.php:9:53 - Class or interface Symfony\Component\EventDispatcher\EventSubscriberInterface does not exist
947abstract class AbstractPrepareSubscriber implements EventSubscriberInterface {
948
949
950ERROR: MissingDependency - Civi/Api4/Event/Subscriber/Generic/PreCreationSubscriber.php:8:46 - Civi\Api4\Event\Subscriber\Generic\AbstractPrepareSubscriber depends on class or interface symfony\component\eventdispatcher\eventsubscriberinterface that does not exist
951abstract class PreCreationSubscriber extends AbstractPrepareSubscriber {
952
953
954ERROR: MissingDependency - Civi/Api4/Event/Subscriber/IsCurrentSubscriber.php:14:35 - Civi\Api4\Event\Subscriber\Generic\AbstractPrepareSubscriber depends on class or interface symfony\component\eventdispatcher\eventsubscriberinterface that does not exist
955class IsCurrentSubscriber extends Generic\AbstractPrepareSubscriber {
956
957
958ERROR: MissingDependency - Civi/Api4/Event/Subscriber/OptionValuePreCreationSubscriber.php:8:48 - Civi\Api4\Event\Subscriber\Generic\PreCreationSubscriber depends on class or interface symfony\component\eventdispatcher\eventsubscriberinterface that does not exist
959class OptionValuePreCreationSubscriber extends Generic\PreCreationSubscriber {
960
961
962ERROR: UndefinedClass - Civi/Api4/Event/Subscriber/PermissionCheckSubscriber.php:38:44 - Class or interface Symfony\Component\EventDispatcher\EventSubscriberInterface does not exist
963class PermissionCheckSubscriber implements EventSubscriberInterface {
964
965
966ERROR: UndefinedClass - Civi/Api4/Event/Subscriber/PostSelectQuerySubscriber.php:15:44 - Class or interface Symfony\Component\EventDispatcher\EventSubscriberInterface does not exist
967class PostSelectQuerySubscriber implements EventSubscriberInterface {
968
969
970ERROR: MissingDependency - Civi/Api4/Event/Subscriber/ValidateFieldsSubscriber.php:35:40 - Civi\Api4\Event\Subscriber\Generic\AbstractPrepareSubscriber depends on class or interface symfony\component\eventdispatcher\eventsubscriberinterface that does not exist
971class ValidateFieldsSubscriber extends Generic\AbstractPrepareSubscriber {
972
973
974ERROR: MissingPropertyType - Civi/Api4/Generic/AbstractAction.php:56:13 - Property Civi\Api4\Generic\AbstractAction::$_entityName does not have a declared type - consider string|false
975 protected $_entityName;
976
977
978ERROR: MissingPropertyType - Civi/Api4/Generic/AbstractAction.php:59:13 - Property Civi\Api4\Generic\AbstractAction::$_actionName does not have a declared type - consider string
979 protected $_actionName;
980
981
982ERROR: MissingPropertyType - Civi/Api4/Generic/AbstractAction.php:62:11 - Property Civi\Api4\Generic\AbstractAction::$_reflection does not have a declared type - consider ReflectionClass<mixed>|null
983 private $_reflection;
984
985
986ERROR: MissingPropertyType - Civi/Api4/Generic/AbstractAction.php:65:11 - Property Civi\Api4\Generic\AbstractAction::$_paramInfo does not have a declared type - consider non-empty-array<string, array<array-key, mixed>>|null
987 private $_paramInfo;
988
989
990ERROR: MissingPropertyType - Civi/Api4/Generic/AbstractAction.php:68:11 - Property Civi\Api4\Generic\AbstractAction::$_entityFields does not have a declared type
991 private $_entityFields;
992
993
994ERROR: MissingPropertyType - Civi/Api4/Generic/AbstractAction.php:71:11 - Property Civi\Api4\Generic\AbstractAction::$_arrayStorage does not have a declared type - consider array
995 private $_arrayStorage = [];
996
997
998ERROR: PossiblyFalseOperand - Civi/Api4/Generic/AbstractAction.php:83:41 - Left operand cannot be falsable, got int|false
999 $entityName = substr($entityName, strrpos($entityName, '\\') + 1);
1000
1001
1002ERROR: MissingParamType - Civi/Api4/Generic/AbstractAction.php:95:25 - Parameter $name has no provided type
1003 public function __set($name, $value) {
1004
1005
1006ERROR: MissingParamType - Civi/Api4/Generic/AbstractAction.php:95:32 - Parameter $value has no provided type
1007 public function __set($name, $value) {
1008
1009
1010ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:96:15 - Class or interface API_Exception does not exist
1011 throw new \API_Exception('Unknown api parameter');
1012
1013
1014ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:106:17 - Class or interface API_Exception does not exist
1015 throw new \API_Exception('Cannot modify api version');
1016
1017
1018ERROR: MissingParamType - Civi/Api4/Generic/AbstractAction.php:133:26 - Parameter $name has no provided type
1019 public function __call($name, $arguments) {
1020
1021
1022ERROR: MissingParamType - Civi/Api4/Generic/AbstractAction.php:133:33 - Parameter $arguments has no provided type
1023 public function __call($name, $arguments) {
1024
1025
1026ERROR: MixedArgument - Civi/Api4/Generic/AbstractAction.php:134:29 - Argument 1 of substr cannot be mixed, expecting string
1027 $param = lcfirst(substr($name, 3));
1028
1029
1030ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:136:17 - Class or interface API_Exception does not exist
1031 throw new \API_Exception('Unknown api parameter: ' . $name);
1032
1033
1034ERROR: MixedArgument - Civi/Api4/Generic/AbstractAction.php:138:20 - Argument 1 of substr cannot be mixed, expecting string
1035 $mode = substr($name, 0, 3);
1036
1037
1038ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:149:27 - Cannot access array value on mixed variable $arguments
1039 $this->$param = $arguments[0];
1040
1041
1042ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:154:23 - Class or interface API_Exception does not exist
1043 throw new \API_Exception('Cannot add to non-array param');
1044
1045
1046ERROR: MixedArgument - Civi/Api4/Generic/AbstractAction.php:156:35 - Argument 2 of array_key_exists cannot be mixed, expecting array<array-key, mixed>
1047 if (array_key_exists(1, $arguments)) {
1048
1049
1050ERROR: MixedAssignment - Civi/Api4/Generic/AbstractAction.php:157:13 - Cannot assign to a mixed type
1051 $this->{$param}[$arguments[0]] = $arguments[1];
1052
1053
1054ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:157:29 - Cannot access array value on mixed variable $arguments
1055 $this->{$param}[$arguments[0]] = $arguments[1];
1056
1057
1058ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:157:46 - Cannot access array value on mixed variable $arguments
1059 $this->{$param}[$arguments[0]] = $arguments[1];
1060
1061
1062ERROR: MixedAssignment - Civi/Api4/Generic/AbstractAction.php:160:13 - Cannot assign to a mixed type
1063 $this->{$param}[] = $arguments[0];
1064
1065
1066ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:160:33 - Cannot access array value on mixed variable $arguments
1067 $this->{$param}[] = $arguments[0];
1068
1069
1070ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:165:15 - Class or interface API_Exception does not exist
1071 throw new \API_Exception('Unknown api parameter: ' . $name);
1072
1073
1074ERROR: MixedInferredReturnType - Civi/Api4/Generic/AbstractAction.php:174:14 - Could not verify return type 'Civi\Api4\Generic\Result' for Civi\Api4\Generic\AbstractAction::execute
1075 /**
1076 * Invoke api call.
1077 *
1078 * At this point all the params have been sent in and we initiate the api call & return the result.
1079 * This is basically the outer wrapper for api v4.
1080 *
1081 * @return \Civi\Api4\Generic\Result
1082 * @throws UnauthorizedException
1083 */
1084 public function execute() {
1085 /** @var Kernel $kernel */
1086 $kernel = \Civi::service('civi_api_kernel');
1087
1088 return $kernel->runRequest($this);
1089 }
1090
1091
1092ERROR: UndefinedDocblockClass - Civi/Api4/Generic/AbstractAction.php:179:5 - Docblock-defined class or interface Civi\API\Kernel does not exist
1093 /** @var Kernel $kernel */
1094 $kernel = \Civi::service('civi_api_kernel');
1095
1096
1097ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:179:15 - Class or interface Civi does not exist
1098 $kernel = \Civi::service('civi_api_kernel');
1099
1100
1101ERROR: MixedAssignment - Civi/Api4/Generic/AbstractAction.php:199:9 - Cannot assign to a mixed type
1102 $params[$name] = $this->$name;
1103
1104
1105ERROR: MixedInferredReturnType - Civi/Api4/Generic/AbstractAction.php:209:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\AbstractAction::getParamInfo
1106 /**
1107 * Get documentation for one or all params
1108 *
1109 * @param string $param
1110 * @return array of arrays [description, type, default, (comment)]
1111 */
1112 public function getParamInfo($param = NULL) {
1113 if (!isset($this->_paramInfo)) {
1114 $defaults = $this->getParamDefaults();
1115
1116
1117ERROR: MixedReturnStatement - Civi/Api4/Generic/AbstractAction.php:222:12 - Could not infer a return type
1118 return $param ? $this->_paramInfo[$param] : $this->_paramInfo;
1119
1120
1121ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:222:21 - Cannot access array value on mixed variable $this->_paramInfo
1122 return $param ? $this->_paramInfo[$param] : $this->_paramInfo;
1123
1124
1125ERROR: MixedInferredReturnType - Civi/Api4/Generic/AbstractAction.php:226:14 - Could not verify return type 'string' for Civi\Api4\Generic\AbstractAction::getEntityName
1126 /**
1127 * @return string
1128 */
1129 public function getEntityName() {
1130 return $this->_entityName;
1131 }
1132
1133
1134ERROR: MixedReturnStatement - Civi/Api4/Generic/AbstractAction.php:229:12 - Could not infer a return type
1135 return $this->_entityName;
1136
1137
1138ERROR: MixedInferredReturnType - Civi/Api4/Generic/AbstractAction.php:234:14 - Could not verify return type 'string' for Civi\Api4\Generic\AbstractAction::getActionName
1139 /**
1140 *
1141 * @return string
1142 */
1143 public function getActionName() {
1144 return $this->_actionName;
1145 }
1146
1147
1148ERROR: MixedReturnStatement - Civi/Api4/Generic/AbstractAction.php:237:12 - Could not infer a return type
1149 return $this->_actionName;
1150
1151
1152ERROR: MixedArrayOffset - Civi/Api4/Generic/AbstractAction.php:259:103 - Cannot access value on variable $this->_arrayStorage using mixed offset
1153 return in_array($offset, ['entity', 'action', 'params', 'version', 'check_permissions']) || isset($this->_arrayStorage[$offset]);
1154
1155
1156ERROR: MixedOperand - Civi/Api4/Generic/AbstractAction.php:268:7 - Left operand cannot be mixed
1157 $offset .= 'Name';
1158
1159
1160ERROR: MixedArgument - Civi/Api4/Generic/AbstractAction.php:271:33 - Argument 1 of ucfirst cannot be mixed, expecting string
1161 $getter = 'get' . ucfirst($offset);
1162
1163
1164ERROR: MixedAssignment - Civi/Api4/Generic/AbstractAction.php:272:7 - Cannot assign $val to a mixed type
1165 $val = $this->$getter();
1166
1167
1168ERROR: MixedArrayOffset - Civi/Api4/Generic/AbstractAction.php:278:15 - Cannot access value on variable $this->_arrayStorage using mixed offset
1169 if (isset($this->_arrayStorage[$offset])) {
1170
1171
1172ERROR: MixedArrayOffset - Civi/Api4/Generic/AbstractAction.php:279:14 - Cannot access value on variable $this->_arrayStorage using mixed offset
1173 return $this->_arrayStorage[$offset];
1174
1175
1176ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:279:14 - Cannot access array value on mixed variable $this->_arrayStorage
1177 return $this->_arrayStorage[$offset];
1178
1179
1180ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:289:17 - Class or interface API_Exception does not exist
1181 throw new \API_Exception('Cannot modify api4 state via array access');
1182
1183
1184ERROR: MixedArgument - Civi/Api4/Generic/AbstractAction.php:292:34 - Argument 1 of setCheckPermissions cannot be mixed, expecting bool
1185 $this->setCheckPermissions($value);
1186
1187
1188ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:304:17 - Class or interface API_Exception does not exist
1189 throw new \API_Exception('Cannot modify api4 state via array access');
1190
1191
1192ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:306:11 - Cannot access array value on mixed variable $this->_arrayStorage
1193 unset($this->_arrayStorage[$offset]);
1194
1195
1196ERROR: MixedArrayOffset - Civi/Api4/Generic/AbstractAction.php:306:11 - Cannot access value on variable $this->_arrayStorage using mixed offset
1197 unset($this->_arrayStorage[$offset]);
1198
1199
1200ERROR: MixedInferredReturnType - Civi/Api4/Generic/AbstractAction.php:314:14 - Could not verify return type 'bool' for Civi\Api4\Generic\AbstractAction::isAuthorized
1201 /**
1202 * Is this api call permitted?
1203 *
1204 * This function is called if checkPermissions is set to true.
1205 *
1206 * @return bool
1207 */
1208 public function isAuthorized() {
1209 $permissions = $this->getPermissions();
1210 return \CRM_Core_Permission::check($permissions);
1211 }
1212
1213
1214ERROR: MixedAssignment - Civi/Api4/Generic/AbstractAction.php:317:5 - Cannot assign $permissions to a mixed type
1215 $permissions = $this->getPermissions();
1216
1217
1218ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:318:12 - Class or interface CRM_Core_Permission does not exist
1219 return \CRM_Core_Permission::check($permissions);
1220
1221
1222ERROR: MissingReturnType - Civi/Api4/Generic/AbstractAction.php:321:19 - Method Civi\Api4\Generic\AbstractAction::getPermissions does not have a return type
1223 public function getPermissions() {
1224
1225
1226ERROR: MixedAssignment - Civi/Api4/Generic/AbstractAction.php:322:5 - Cannot assign $permissions to a mixed type
1227 $permissions = call_user_func(["\\Civi\\Api4\\" . $this->_entityName, 'permissions']);
1228
1229
1230ERROR: MixedOperand - Civi/Api4/Generic/AbstractAction.php:322:55 - Right operand cannot be mixed
1231 $permissions = call_user_func(["\\Civi\\Api4\\" . $this->_entityName, 'permissions']);
1232
1233
1234ERROR: MixedOperand - Civi/Api4/Generic/AbstractAction.php:323:5 - Left operand cannot be mixed
1235 $permissions += [
1236
1237
1238ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:331:14 - Cannot access array value on mixed variable $permissions
1239 return $permissions[$action];
1240
1241
1242ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:334:14 - Cannot access array value on mixed variable $permissions
1243 return $permissions['meta'];
1244
1245
1246ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractAction.php:336:12 - Cannot access array value on mixed variable $permissions
1247 return $permissions['default'];
1248
1249
1250ERROR: MixedInferredReturnType - Civi/Api4/Generic/AbstractAction.php:342:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\AbstractAction::entityFields
1251 /**
1252 * Returns schema fields for this entity & action.
1253 *
1254 * @return array
1255 * @throws \API_Exception
1256 */
1257 public function entityFields() {
1258 if (!$this->_entityFields) {
1259 $params = [
1260 'action' => $this->getActionName(),
1261
1262
1263ERROR: UndefinedFunction - Civi/Api4/Generic/AbstractAction.php:354:38 - Function Civi\Api4\Generic\civicrm_api4 does not exist
1264 $this->_entityFields = (array) civicrm_api4($this->getEntityName(), 'getFields', $params, 'name');
1265
1266
1267ERROR: MixedInferredReturnType - Civi/Api4/Generic/AbstractAction.php:360:14 - Could not verify return type 'ReflectionClass' for Civi\Api4\Generic\AbstractAction::reflect
1268 /**
1269 * @return \ReflectionClass
1270 */
1271 public function reflect() {
1272 if (!$this->_reflection) {
1273 $this->_reflection = new \ReflectionClass($this);
1274 }
1275 return $this->_reflection;
1276 }
1277
1278
1279ERROR: MixedReturnStatement - Civi/Api4/Generic/AbstractAction.php:366:12 - Could not infer a return type
1280 return $this->_reflection;
1281
1282
1283ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:384:17 - Class or interface API_Exception does not exist
1284 throw new \API_Exception('Illegal character in expression');
1285
1286
1287ERROR: MixedArgument - Civi/Api4/Generic/AbstractAction.php:387:24 - Argument 1 of trim cannot be mixed, expecting string
1288 return (bool) trim(\CRM_Core_Smarty::singleton()->fetchWith('string:' . $tpl, $vars));
1289
1290
1291ERROR: UndefinedClass - Civi/Api4/Generic/AbstractAction.php:387:24 - Class or interface CRM_Core_Smarty does not exist
1292 return (bool) trim(\CRM_Core_Smarty::singleton()->fetchWith('string:' . $tpl, $vars));
1293
1294
1295ERROR: MixedInferredReturnType - Civi/Api4/Generic/AbstractBatchAction.php:40:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\AbstractBatchAction::getBatchRecords
1296 /**
1297 * @return array
1298 */
1299 protected function getBatchRecords() {
1300 $params = [
1301 'checkPermissions' => $this->checkPermissions,
1302 'where' => $this->where,
1303 'orderBy' => $this->orderBy,
1304
1305
1306ERROR: UndefinedFunction - Civi/Api4/Generic/AbstractBatchAction.php:54:20 - Function Civi\Api4\Generic\civicrm_api4 does not exist
1307 return (array) civicrm_api4($this->getEntityName(), 'get', $params);
1308
1309
1310ERROR: MissingReturnType - Civi/Api4/Generic/AbstractCreateAction.php:35:22 - Method Civi\Api4\Generic\AbstractCreateAction::validateValues does not have a return type, expecting void
1311 protected function validateValues() {
1312
1313
1314ERROR: MixedAssignment - Civi/Api4/Generic/AbstractCreateAction.php:38:53 - Cannot assign $fieldInfo to a mixed type
1315 foreach ($this->entityFields() as $fieldName => $fieldInfo) {
1316
1317
1318ERROR: MixedArgumentTypeCoercion - Civi/Api4/Generic/AbstractCreateAction.php:39:28 - Argument 1 of Civi\Api4\Generic\AbstractCreateAction::getvalue expects string, parent type array-key provided
1319 if (!$this->getValue($fieldName)) {
1320
1321
1322ERROR: MixedArgument - Civi/Api4/Generic/AbstractCreateAction.php:45:40 - Argument 1 of Civi\Api4\Generic\AbstractCreateAction::evaluatecondition cannot be mixed, expecting string
1323 if ($this->evaluateCondition($fieldInfo['required_if'], $params)) {
1324
1325
1326ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractCreateAction.php:45:40 - Cannot access array value on mixed variable $fieldInfo
1327 if ($this->evaluateCondition($fieldInfo['required_if'], $params)) {
1328
1329
1330ERROR: UndefinedClass - Civi/Api4/Generic/AbstractCreateAction.php:52:17 - Class or interface API_Exception does not exist
1331 throw new \API_Exception("Mandatory values missing from Api4 {$this->getEntityName()}::{$this->getActionName()}: '" . implode("', '", $unmatched) . "'", "mandatory_missing", ["fields" => $unmatched]);
1332
1333
1334ERROR: MissingReturnType - Civi/Api4/Generic/AbstractEntity.php:40:26 - Method Civi\Api4\Generic\AbstractEntity::getFields does not have a return type, expecting void
1335 public static function getFields() {
1336
1337
1338ERROR: UndefinedClass - Civi/Api4/Generic/AbstractEntity.php:41:15 - Class or interface Civi\API\Exception\NotImplementedException does not exist
1339 throw new NotImplementedException(self::getEntityName() . ' should implement getFields action.');
1340
1341
1342ERROR: MixedInferredReturnType - Civi/Api4/Generic/AbstractEntity.php:47:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\AbstractEntity::permissions
1343 /**
1344 * Returns a list of permissions needed to access the various actions in this api.
1345 *
1346 * @return array
1347 */
1348 public static function permissions() {
1349 $permissions = \CRM_Core_Permission::getEntityActionPermissions();
1350
1351 // For legacy reasons the permissions are keyed by lowercase entity name
1352
1353
1354ERROR: UndefinedClass - Civi/Api4/Generic/AbstractEntity.php:50:20 - Class or interface CRM_Core_Permission does not exist
1355 $permissions = \CRM_Core_Permission::getEntityActionPermissions();
1356
1357
1358ERROR: PossiblyFalseOperand - Civi/Api4/Generic/AbstractEntity.php:64:34 - Left operand cannot be falsable, got int|false
1359 return substr(static::class, strrpos(static::class, '\\') + 1);
1360
1361
1362ERROR: MoreSpecificReturnType - Civi/Api4/Generic/AbstractEntity.php:72:14 - The declared return type 'Civi\Api4\Generic\AbstractAction' for Civi\Api4\Generic\AbstractEntity::__callStatic is more specific than the inferred return type 'object'
1363 /**
1364 * Magic method to return the action object for an api.
1365 *
1366 * @param string $action
1367 * @param null $args
1368 * @return AbstractAction
1369 * @throws NotImplementedException
1370 */
1371 public static function __callStatic($action, $args) {
1372 $entity = self::getEntityName();
1373 // Find class for this action
1374
1375
1376ERROR: MixedMethodCall - Civi/Api4/Generic/AbstractEntity.php:80:23 - Cannot call constructor on an unknown class
1377 $actionObject = new $entityAction($entity, $action);
1378
1379
1380ERROR: UndefinedClass - Civi/Api4/Generic/AbstractEntity.php:83:17 - Class or interface Civi\API\Exception\NotImplementedException does not exist
1381 throw new NotImplementedException("Api $entity $action version 4 does not exist.");
1382
1383
1384ERROR: LessSpecificReturnStatement - Civi/Api4/Generic/AbstractEntity.php:85:12 - The type 'object' is more general than the declared return type 'Civi\Api4\Generic\AbstractAction' for Civi\Api4\Generic\AbstractEntity::__callStatic
1385 return $actionObject;
1386
1387
1388ERROR: UndefinedClass - Civi/Api4/Generic/AbstractQueryAction.php:70:24 - Class or interface CRM_Core_DAO does not exist
1389 if (!in_array($op, \CRM_Core_DAO::acceptedSQLOperators())) {
1390
1391
1392ERROR: MixedArgument - Civi/Api4/Generic/AbstractQueryAction.php:70:24 - Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed>
1393 if (!in_array($op, \CRM_Core_DAO::acceptedSQLOperators())) {
1394
1395
1396ERROR: UndefinedClass - Civi/Api4/Generic/AbstractQueryAction.php:71:17 - Class or interface API_Exception does not exist
1397 throw new \API_Exception('Unsupported operator');
1398
1399
1400ERROR: MixedArrayAccess - Civi/Api4/Generic/AbstractQueryAction.php:88:19 - Cannot access array value on mixed variable $condition1
1401 if (!is_array($condition1[0])) {
1402
1403
1404ERROR: RedundantConditionGivenDocblockType - Civi/Api4/Generic/AbstractQueryAction.php:117:9 - Found a redundant condition when evaluating docblock-defined type $whereClause and trying to reconcile type 'array<array-key, mixed>' to array
1405 if (!is_array($whereClause) || !$whereClause) {
1406
1407
1408ERROR: DocblockTypeContradiction - Civi/Api4/Generic/AbstractQueryAction.php:117:10 - Found a contradiction with a docblock-defined type when evaluating $whereClause and trying to reconcile type 'array<array-key, mixed>' to !array
1409 if (!is_array($whereClause) || !$whereClause) {
1410
1411
1412ERROR: MixedAssignment - Civi/Api4/Generic/AbstractQueryAction.php:121:7 - Cannot assign $op to a mixed type
1413 $op = array_shift($whereClause);
1414
1415
1416ERROR: MixedArgument - Civi/Api4/Generic/AbstractQueryAction.php:126:71 - Argument 2 of Civi\Api4\Generic\AbstractQueryAction::whereclausetostring cannot be mixed, expecting string
1417 return $output . '(' . $this->whereClauseToString($whereClause, $op) . ')';
1418
1419
1420ERROR: UndefinedClass - Civi/Api4/Generic/AbstractQueryAction.php:128:65 - Class or interface CRM_Core_DAO does not exist
1421 elseif (isset($whereClause[1]) && in_array($whereClause[1], \CRM_Core_DAO::acceptedSQLOperators())) {
1422
1423
1424ERROR: MixedArgument - Civi/Api4/Generic/AbstractQueryAction.php:128:65 - Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed>
1425 elseif (isset($whereClause[1]) && in_array($whereClause[1], \CRM_Core_DAO::acceptedSQLOperators())) {
1426
1427
1428ERROR: MixedOperand - Civi/Api4/Generic/AbstractQueryAction.php:129:17 - Left operand cannot be mixed
1429 $output = $whereClause[0] . ' ' . $whereClause[1] . ' ';
1430
1431
1432ERROR: MixedOperand - Civi/Api4/Generic/AbstractQueryAction.php:129:41 - Right operand cannot be mixed
1433 $output = $whereClause[0] . ' ' . $whereClause[1] . ' ';
1434
1435
1436ERROR: MixedOperand - Civi/Api4/Generic/AbstractQueryAction.php:131:20 - Right operand cannot be mixed
1437 $output .= is_array($whereClause[2]) ? '[' . implode(', ', $whereClause[2]) . ']' : $whereClause[2];
1438
1439
1440ERROR: MixedAssignment - Civi/Api4/Generic/AbstractQueryAction.php:136:46 - Cannot assign $clause to a mixed type
1441 foreach (array_filter($whereClause) as $clause) {
1442
1443
1444ERROR: MixedArgument - Civi/Api4/Generic/AbstractQueryAction.php:137:49 - Argument 1 of Civi\Api4\Generic\AbstractQueryAction::whereclausetostring cannot be mixed, expecting array<array-key, mixed>|null
1445 $clauses[] = $this->whereClauseToString($clause, $op);
1446
1447
1448ERROR: PossiblyNullPropertyAssignmentValue - Civi/Api4/Generic/BasicBatchAction.php:37:19 - $this->doer with non-nullable declared type 'callable' cannot be assigned nullable type 'callable|null'
1449 $this->doer = $doer;
1450
1451
1452ERROR: MissingReturnType - Civi/Api4/Generic/BasicBatchAction.php:46:19 - Method Civi\Api4\Generic\BasicBatchAction::_run does not have a return type, expecting void
1453 public function _run(Result $result) {
1454
1455
1456ERROR: MixedAssignment - Civi/Api4/Generic/BasicBatchAction.php:47:42 - Cannot assign $item to a mixed type
1457 foreach ($this->getBatchRecords() as $item) {
1458
1459
1460ERROR: MixedArgument - Civi/Api4/Generic/BasicBatchAction.php:48:33 - Argument 1 of Civi\Api4\Generic\BasicBatchAction::dotask cannot be mixed, expecting array<array-key, mixed>
1461 $result[] = $this->doTask($item);
1462
1463
1464ERROR: MixedInferredReturnType - Civi/Api4/Generic/BasicBatchAction.php:62:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\BasicBatchAction::doTask
1465 /**
1466 * This Basic Batch class can be used in one of two ways:
1467 *
1468 * 1. Use this class directly by passing a callable ($doer) to the constructor.
1469 * 2. Extend this class and override this function.
1470 *
1471 * Either way, this function should return an array with an output record
1472 * for the item.
1473 *
1474 * @param array $item
1475 * @return array
1476 * @throws \Civi\API\Exception\NotImplementedException
1477 */
1478 protected function doTask($item) {
1479 if (is_callable($this->doer)) {
1480 return call_user_func($this->doer, $item, $this);
1481 }
1482
1483
1484ERROR: RedundantConditionGivenDocblockType - Civi/Api4/Generic/BasicBatchAction.php:66:9 - Found a redundant condition when evaluating docblock-defined type $this->doer and trying to reconcile type 'callable' to callable
1485 if (is_callable($this->doer)) {
1486
1487
1488ERROR: MixedReturnStatement - Civi/Api4/Generic/BasicBatchAction.php:67:14 - Could not infer a return type
1489 return call_user_func($this->doer, $item, $this);
1490
1491
1492ERROR: UndefinedClass - Civi/Api4/Generic/BasicBatchAction.php:69:15 - Class or interface Civi\API\Exception\NotImplementedException does not exist
1493 throw new NotImplementedException('Doer function not found for api4 ' . $this->getEntityName() . '::' . $this->getActionName());
1494
1495
1496ERROR: PossiblyNullPropertyAssignmentValue - Civi/Api4/Generic/BasicCreateAction.php:31:21 - $this->setter with non-nullable declared type 'callable' cannot be assigned nullable type 'callable|null'
1497 $this->setter = $setter;
1498
1499
1500ERROR: MissingReturnType - Civi/Api4/Generic/BasicCreateAction.php:40:19 - Method Civi\Api4\Generic\BasicCreateAction::_run does not have a return type, expecting void
1501 public function _run(Result $result) {
1502
1503
1504ERROR: MixedInferredReturnType - Civi/Api4/Generic/BasicCreateAction.php:54:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\BasicCreateAction::writeRecord
1505 /**
1506 * This Basic Create class can be used in one of two ways:
1507 *
1508 * 1. Use this class directly by passing a callable ($setter) to the constructor.
1509 * 2. Extend this class and override this function.
1510 *
1511 * Either way, this function should return an array representing the one new object.
1512 *
1513 * @param array $item
1514 * @return array
1515 * @throws \Civi\API\Exception\NotImplementedException
1516 */
1517 protected function writeRecord($item) {
1518 if (is_callable($this->setter)) {
1519
1520
1521ERROR: RedundantConditionGivenDocblockType - Civi/Api4/Generic/BasicCreateAction.php:58:9 - Found a redundant condition when evaluating docblock-defined type $this->setter and trying to reconcile type 'callable' to callable
1522 if (is_callable($this->setter)) {
1523
1524
1525ERROR: MixedReturnStatement - Civi/Api4/Generic/BasicCreateAction.php:59:14 - Could not infer a return type
1526 return call_user_func($this->setter, $item, $this);
1527
1528
1529ERROR: UndefinedClass - Civi/Api4/Generic/BasicCreateAction.php:61:15 - Class or interface Civi\API\Exception\NotImplementedException does not exist
1530 throw new NotImplementedException('Setter function not found for api4 ' . $this->getEntityName() . '::' . $this->getActionName());
1531
1532
1533ERROR: PossiblyNullPropertyAssignmentValue - Civi/Api4/Generic/BasicGetAction.php:31:21 - $this->getter with non-nullable declared type 'callable' cannot be assigned nullable type 'callable|null'
1534 $this->getter = $getter;
1535
1536
1537ERROR: PossiblyNullPropertyAssignmentValue - Civi/Api4/Generic/BasicGetAction.php:31:21 - $this->getter with non-nullable declared type 'callable' cannot be assigned nullable type 'callable|null'
1538 $this->getter = $getter;
1539
1540
1541ERROR: PossiblyNullPropertyAssignmentValue - Civi/Api4/Generic/BasicGetAction.php:31:21 - $this->getter with non-nullable declared type 'callable' cannot be assigned nullable type 'callable|null'
1542 $this->getter = $getter;
1543
1544
1545ERROR: MissingReturnType - Civi/Api4/Generic/BasicGetAction.php:39:19 - Method Civi\Api4\Generic\BasicGetAction::_run does not have a return type, expecting void
1546 public function _run(Result $result) {
1547
1548
1549ERROR: MixedInferredReturnType - Civi/Api4/Generic/BasicGetAction.php:73:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\BasicGetAction::getRecords
1550 /**
1551 * This Basic Get class is a general-purpose api for non-DAO-based entities.
1552 *
1553 * Useful for fetching records from files or other places.
1554 * You can specify any php function to retrieve the records, and this class will
1555 * automatically filter, sort, select & limit the raw data from your callback.
1556 *
1557 * You can implement this action in one of two ways:
1558 * 1. Use this class directly by passing a callable ($getter) to the constructor.
1559 * 2. Extend this class and override this function.
1560 *
1561 * Either way, this function should return an array of arrays, each representing one retrieved object.
1562 *
1563 * The simplest thing for your getter function to do is return every full record
1564 * and allow this class to automatically do the sorting and filtering.
1565 *
1566 * Sometimes however that may not be practical for performance reasons.
1567 * To optimize your getter, it can use the following helpers from $this:
1568 *
1569 * Use this->_itemsToGet() to match records to field values in the WHERE clause.
1570 * Note the WHERE clause can potentially be very complex and it is not recommended
1571 * to parse $this->where yourself.
1572 *
1573 * Use $this->_isFieldSelected() to check if a field value is called for - useful
1574 * if loading the field involves expensive calculations.
1575 *
1576 * Be careful not to make assumptions, e.g. if LIMIT 100 is specified and your getter "helpfully" truncates the list
1577 * at 100 without accounting for WHERE, ORDER BY and LIMIT clauses, the final filtered result may be very incorrect.
1578 *
1579 * @return array
1580 * @throws \Civi\API\Exception\NotImplementedException
1581 */
1582 protected function getRecords() {
1583 if (is_callable($this->getter)) {
1584 return call_user_func($this->getter, $this);
1585 }
1586
1587
1588ERROR: RedundantConditionGivenDocblockType - Civi/Api4/Generic/BasicGetAction.php:77:9 - Found a redundant condition when evaluating docblock-defined type $this->getter and trying to reconcile type 'callable' to callable
1589 if (is_callable($this->getter)) {
1590
1591
1592ERROR: MixedReturnStatement - Civi/Api4/Generic/BasicGetAction.php:78:14 - Could not infer a return type
1593 return call_user_func($this->getter, $this);
1594
1595
1596ERROR: UndefinedClass - Civi/Api4/Generic/BasicGetAction.php:80:15 - Class or interface Civi\API\Exception\NotImplementedException does not exist
1597 throw new NotImplementedException('Getter function not found for api4 ' . $this->getEntityName() . '::' . $this->getActionName());
1598
1599
1600ERROR: MixedAssignment - Civi/Api4/Generic/BasicGetAction.php:97:30 - Cannot assign $clause to a mixed type
1601 foreach ($this->where as $clause) {
1602
1603
1604ERROR: MixedArrayAccess - Civi/Api4/Generic/BasicGetAction.php:98:11 - Cannot access array value on mixed variable $clause
1605 if ($clause[0] == $field && in_array($clause[1], ['=', 'IN'])) {
1606
1607
1608ERROR: MixedArrayAccess - Civi/Api4/Generic/BasicGetAction.php:98:44 - Cannot access array value on mixed variable $clause
1609 if ($clause[0] == $field && in_array($clause[1], ['=', 'IN'])) {
1610
1611
1612ERROR: MixedArrayAccess - Civi/Api4/Generic/BasicGetAction.php:99:24 - Cannot access array value on mixed variable $clause
1613 return (array) $clause[2];
1614
1615
1616ERROR: MixedAssignment - Civi/Api4/Generic/BasicGetAction.php:131:26 - Cannot assign $clause to a mixed type
1617 foreach ($clauses as $clause) {
1618
1619
1620ERROR: MissingReturnType - Civi/Api4/Generic/BasicGetFieldsAction.php:43:19 - Method Civi\Api4\Generic\BasicGetFieldsAction::_run does not have a return type, expecting void
1621 public function _run(Result $result) {
1622
1623
1624ERROR: UndefinedClass - Civi/Api4/Generic/BasicGetFieldsAction.php:47:12 - Class or interface Civi\API\Exception\NotImplementedException does not exist
1625 catch (NotImplementedException $e) {
1626
1627
1628ERROR: MissingReturnType - Civi/Api4/Generic/BasicGetFieldsAction.php:69:22 - Method Civi\Api4\Generic\BasicGetFieldsAction::padResults does not have a return type, expecting void
1629 protected function padResults(&$values) {
1630
1631
1632ERROR: MixedArgument - Civi/Api4/Generic/BasicGetFieldsAction.php:70:28 - Argument 1 of array_column cannot be mixed, expecting array<array-key, mixed>
1633 $fields = array_column($this->fields(), 'name');
1634
1635
1636ERROR: MixedAssignment - Civi/Api4/Generic/BasicGetFieldsAction.php:71:26 - Cannot assign $field to a mixed type
1637 foreach ($values as &$field) {
1638
1639
1640ERROR: MixedArgument - Civi/Api4/Generic/BasicGetFieldsAction.php:73:81 - Argument 3 of str_replace cannot be mixed, expecting array<array-key, mixed>|string
1641 'title' => empty($field['name']) ? NULL : ucwords(str_replace('_', ' ', $field['name'])),
1642
1643
1644ERROR: MixedArrayAccess - Civi/Api4/Generic/BasicGetFieldsAction.php:73:81 - Cannot access array value on mixed variable $field
1645 'title' => empty($field['name']) ? NULL : ucwords(str_replace('_', ' ', $field['name'])),
1646
1647
1648ERROR: UndefinedClass - Civi/Api4/Generic/BasicGetFieldsAction.php:77:24 - Class or interface CRM_Utils_Array does not exist
1649 'data_type' => \CRM_Utils_Array::value('type', $field, 'String'),
1650
1651
1652ERROR: MixedOperand - Civi/Api4/Generic/BasicGetFieldsAction.php:79:7 - Left operand cannot be mixed
1653 $field += $defaults;
1654
1655
1656ERROR: MixedArrayAccess - Civi/Api4/Generic/BasicGetFieldsAction.php:81:36 - Cannot access array value on mixed variable $field
1657 $field['options'] = (bool) $field['options'];
1658
1659
1660ERROR: MixedOperand - Civi/Api4/Generic/BasicGetFieldsAction.php:83:7 - Left operand cannot be mixed
1661 $field += array_fill_keys($fields, NULL);
1662
1663
1664ERROR: MissingReturnType - Civi/Api4/Generic/BasicGetFieldsAction.php:94:19 - Method Civi\Api4\Generic\BasicGetFieldsAction::fields does not have a return type, expecting array{0:array{name:string, data_type:string}, 1:array{name:string, data_type:string}, 2:array{name:string, data_type:string}, 3:array{name:string, data_type:string}, 4:array{name:string, data_type:string}, 5:array{name:string, data_type:string}, 6:array{name:string, data_type:string}, 7:array{name:string, data_type:string}, 8:array{name:string, data_type:string}, 9:array{name:string, data_type:string}}
1665 public function fields() {
1666
1667
1668ERROR: MoreSpecificReturnType - Civi/Api4/Generic/BasicReplaceAction.php:37:14 - The declared return type 'Civi\Api4\Result\ReplaceResult' for Civi\Api4\Generic\BasicReplaceAction::execute is more specific than the inferred return type 'Civi\Api4\Generic\Result'
1669 /**
1670 * @return \Civi\Api4\Result\ReplaceResult
1671 */
1672 public function execute() {
1673 return parent::execute();
1674 }
1675
1676
1677ERROR: LessSpecificReturnStatement - Civi/Api4/Generic/BasicReplaceAction.php:40:12 - The type 'Civi\Api4\Generic\Result' is more general than the declared return type 'Civi\Api4\Result\ReplaceResult' for Civi\Api4\Generic\BasicReplaceAction::execute
1678 return parent::execute();
1679
1680
1681ERROR: MissingReturnType - Civi/Api4/Generic/BasicReplaceAction.php:46:19 - Method Civi\Api4\Generic\BasicReplaceAction::_run does not have a return type, expecting void
1682 public function _run(Result $result) {
1683
1684
1685ERROR: MixedAssignment - Civi/Api4/Generic/BasicReplaceAction.php:51:30 - Cannot assign $clause to a mixed type
1686 foreach ($this->where as $clause) {
1687
1688
1689ERROR: MixedArrayOffset - Civi/Api4/Generic/BasicReplaceAction.php:53:9 - Cannot access value on variable $paramsFromWhere[mixed] using mixed offset
1690 $paramsFromWhere[$clause[0]] = $clause[2];
1691
1692
1693ERROR: MixedAssignment - Civi/Api4/Generic/BasicReplaceAction.php:53:9 - Cannot assign to a mixed type
1694 $paramsFromWhere[$clause[0]] = $clause[2];
1695
1696
1697ERROR: MixedAssignment - Civi/Api4/Generic/BasicReplaceAction.php:57:5 - Cannot assign $idField to a mixed type
1698 $idField = $this->getSelect()[0];
1699
1700
1701ERROR: MixedAssignment - Civi/Api4/Generic/BasicReplaceAction.php:60:32 - Cannot assign $record to a mixed type
1702 foreach ($this->records as $record) {
1703
1704
1705ERROR: MixedOperand - Civi/Api4/Generic/BasicReplaceAction.php:61:7 - Left operand cannot be mixed
1706 $record += $paramsFromWhere;
1707
1708
1709ERROR: MixedArrayOffset - Civi/Api4/Generic/BasicReplaceAction.php:62:18 - Cannot access value on variable $record using mixed offset
1710 if (!empty($record[$idField])) {
1711
1712
1713ERROR: MixedAssignment - Civi/Api4/Generic/BasicReplaceAction.php:63:9 - Cannot assign $id to a mixed type
1714 $id = $record[$idField];
1715
1716
1717ERROR: MixedArrayOffset - Civi/Api4/Generic/BasicReplaceAction.php:63:15 - Cannot access value on variable $record using mixed offset
1718 $id = $record[$idField];
1719
1720
1721ERROR: MixedArrayAccess - Civi/Api4/Generic/BasicReplaceAction.php:63:15 - Cannot access array value on mixed variable $record
1722 $id = $record[$idField];
1723
1724
1725ERROR: MixedArrayOffset - Civi/Api4/Generic/BasicReplaceAction.php:64:15 - Cannot access value on variable $toDelete using mixed offset
1726 unset($toDelete[$id], $record[$idField]);
1727
1728
1729ERROR: UndefinedFunction - Civi/Api4/Generic/BasicReplaceAction.php:65:21 - Function Civi\Api4\Generic\civicrm_api4 does not exist
1730 $result[] = civicrm_api4($this->getEntityName(), 'update', [
1731 'reload' => $this->reload,
1732 'where' => [[$idField, '=', $id]],
1733 'values' => $record,
1734 ])->first();
1735
1736
1737ERROR: UndefinedFunction - Civi/Api4/Generic/BasicReplaceAction.php:79:34 - Function Civi\Api4\Generic\civicrm_api4 does not exist
1738 $result->deleted = (array) civicrm_api4($this->getEntityName(), 'delete', [
1739 'where' => [[$idField, 'IN', array_keys($toDelete)]],
1740 ]);
1741
1742
1743ERROR: PossiblyNullPropertyAssignmentValue - Civi/Api4/Generic/BasicUpdateAction.php:33:21 - $this->setter with non-nullable declared type 'callable' cannot be assigned nullable type 'callable|null'
1744 $this->setter = $setter;
1745
1746
1747ERROR: MissingReturnType - Civi/Api4/Generic/BasicUpdateAction.php:44:19 - Method Civi\Api4\Generic\BasicUpdateAction::_run does not have a return type, expecting void
1748 public function _run(Result $result) {
1749
1750
1751ERROR: MixedAssignment - Civi/Api4/Generic/BasicUpdateAction.php:45:42 - Cannot assign $item to a mixed type
1752 foreach ($this->getBatchRecords() as $item) {
1753
1754
1755ERROR: MixedArgument - Civi/Api4/Generic/BasicUpdateAction.php:46:38 - Argument 1 of Civi\Api4\Generic\BasicUpdateAction::writerecord cannot be mixed, expecting array<array-key, mixed>
1756 $result[] = $this->writeRecord($this->values + $item);
1757
1758
1759ERROR: MixedOperand - Civi/Api4/Generic/BasicUpdateAction.php:46:54 - Right operand cannot be mixed
1760 $result[] = $this->writeRecord($this->values + $item);
1761
1762
1763ERROR: UndefinedClass - Civi/Api4/Generic/BasicUpdateAction.php:50:17 - Class or interface API_Exception does not exist
1764 throw new \API_Exception('Cannot ' . $this->getActionName() . ' ' . $this->getEntityName() . ', no records found with ' . $this->whereClauseToString());
1765
1766
1767ERROR: MixedInferredReturnType - Civi/Api4/Generic/BasicUpdateAction.php:63:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\BasicUpdateAction::writeRecord
1768 /**
1769 * This Basic Update class can be used in one of two ways:
1770 *
1771 * 1. Use this class directly by passing a callable ($setter) to the constructor.
1772 * 2. Extend this class and override this function.
1773 *
1774 * Either way, this function should return an array representing the one modified object.
1775 *
1776 * @param array $item
1777 * @return array
1778 * @throws \Civi\API\Exception\NotImplementedException
1779 */
1780 protected function writeRecord($item) {
1781 if (is_callable($this->setter)) {
1782
1783
1784ERROR: RedundantConditionGivenDocblockType - Civi/Api4/Generic/BasicUpdateAction.php:67:9 - Found a redundant condition when evaluating docblock-defined type $this->setter and trying to reconcile type 'callable' to callable
1785 if (is_callable($this->setter)) {
1786
1787
1788ERROR: MixedReturnStatement - Civi/Api4/Generic/BasicUpdateAction.php:68:14 - Could not infer a return type
1789 return call_user_func($this->setter, $item, $this);
1790
1791
1792ERROR: UndefinedClass - Civi/Api4/Generic/BasicUpdateAction.php:70:15 - Class or interface Civi\API\Exception\NotImplementedException does not exist
1793 throw new NotImplementedException('Setter function not found for api4 ' . $this->getEntityName() . '::' . $this->getActionName());
1794
1795
1796ERROR: MissingReturnType - Civi/Api4/Generic/DAOCreateAction.php:16:19 - Method Civi\Api4\Generic\DAOCreateAction::_run does not have a return type, expecting void
1797 public function _run(Result $result) {
1798
1799
1800ERROR: MissingReturnType - Civi/Api4/Generic/DAOCreateAction.php:29:22 - Method Civi\Api4\Generic\DAOCreateAction::validateValues does not have a return type, expecting void
1801 protected function validateValues() {
1802
1803
1804ERROR: UndefinedClass - Civi/Api4/Generic/DAOCreateAction.php:31:17 - Class or interface API_Exception does not exist
1805 throw new \API_Exception('Cannot pass id to Create action. Use Update action instead.');
1806
1807
1808ERROR: MissingReturnType - Civi/Api4/Generic/DAOCreateAction.php:43:22 - Method Civi\Api4\Generic\DAOCreateAction::fillDefaults does not have a return type, expecting void
1809 protected function fillDefaults(&$params) {
1810
1811
1812ERROR: MixedArgument - Civi/Api4/Generic/DAOCreateAction.php:46:32 - Argument 1 of array_column cannot be mixed, expecting array<array-key, mixed>
1813 $coreFields = array_column($bao::fields(), NULL, 'name');
1814
1815
1816ERROR: UndefinedClass - Civi/Api4/Generic/DAOCreateAction.php:46:32 - Class or interface CRM_Core_DAO does not exist
1817 $coreFields = array_column($bao::fields(), NULL, 'name');
1818
1819
1820ERROR: InvalidStringClass - Civi/Api4/Generic/DAOCreateAction.php:46:32 - String cannot be used as a class
1821 $coreFields = array_column($bao::fields(), NULL, 'name');
1822
1823
1824ERROR: MixedAssignment - Civi/Api4/Generic/DAOCreateAction.php:48:34 - Cannot assign $field to a mixed type
1825 foreach ($fields as $name => $field) {
1826
1827
1828ERROR: UndefinedClass - Civi/Api4/Generic/DAOCreateAction.php:50:99 - Class or interface CRM_Utils_Array does not exist
1829 if (!isset($params[$name]) && !empty($field['default_value']) && $field['default_value'] != \CRM_Utils_Array::pathGet($coreFields, [$name, 'default'])) {
1830
1831
1832ERROR: MixedAssignment - Civi/Api4/Generic/DAOCreateAction.php:51:9 - Cannot assign to a mixed type
1833 $params[$name] = $field['default_value'];
1834
1835
1836ERROR: MissingReturnType - Civi/Api4/Generic/DAODeleteAction.php:14:19 - Method Civi\Api4\Generic\DAODeleteAction::_run does not have a return type, expecting void
1837 public function _run(Result $result) {
1838
1839
1840ERROR: MixedArgument - Civi/Api4/Generic/DAODeleteAction.php:16:61 - Argument 2 of array_diff_key cannot be mixed, expecting array<array-key, mixed>
1841 if ($defaults['where'] && !array_diff_key($this->where, $defaults['where'])) {
1842
1843
1844ERROR: UndefinedClass - Civi/Api4/Generic/DAODeleteAction.php:17:17 - Class or interface API_Exception does not exist
1845 throw new \API_Exception('Cannot delete ' . $this->getEntityName() . ' with no "where" parameter specified');
1846
1847
1848ERROR: UndefinedClass - Civi/Api4/Generic/DAODeleteAction.php:23:17 - Class or interface API_Exception does not exist
1849 throw new \API_Exception('Cannot delete ' . $this->getEntityName() . ', no records found with ' . $this->whereClauseToString());
1850
1851
1852ERROR: MissingParamType - Civi/Api4/Generic/DAODeleteAction.php:36:36 - Parameter $items has no provided type
1853 protected function deleteObjects($items) {
1854
1855
1856ERROR: MixedAssignment - Civi/Api4/Generic/DAODeleteAction.php:40:26 - Cannot assign $item to a mixed type
1857 foreach ($items as $item) {
1858
1859
1860ERROR: MixedArrayAccess - Civi/Api4/Generic/DAODeleteAction.php:41:18 - Cannot access array value on mixed variable $item
1861 $args = [$item['id']];
1862
1863
1864ERROR: MixedAssignment - Civi/Api4/Generic/DAODeleteAction.php:42:9 - Cannot assign $bao to a mixed type
1865 $bao = call_user_func_array([$baoName, 'del'], $args);
1866
1867
1868ERROR: UndefinedClass - Civi/Api4/Generic/DAODeleteAction.php:42:37 - Class or interface CRM_Core_DAO does not exist
1869 $bao = call_user_func_array([$baoName, 'del'], $args);
1870
1871
1872ERROR: InvalidThrow - Civi/Api4/Generic/DAODeleteAction.php:47:11 - Cannot throw API_Exception as it does not extend Exception or implement Throwable
1873 throw new \API_Exception("Could not delete {$this->getEntityName()} id {$item['id']}");
1874
1875
1876ERROR: UndefinedClass - Civi/Api4/Generic/DAODeleteAction.php:47:21 - Class or interface API_Exception does not exist
1877 throw new \API_Exception("Could not delete {$this->getEntityName()} id {$item['id']}");
1878
1879
1880ERROR: MixedAssignment - Civi/Api4/Generic/DAODeleteAction.php:52:26 - Cannot assign $item to a mixed type
1881 foreach ($items as $item) {
1882
1883
1884ERROR: UndefinedClass - Civi/Api4/Generic/DAODeleteAction.php:53:16 - Type CRM_Core_DAO cannot be called as a class
1885 $bao = new $baoName();
1886
1887
1888ERROR: InvalidStringClass - Civi/Api4/Generic/DAODeleteAction.php:53:16 - String cannot be used as a class
1889 $bao = new $baoName();
1890
1891
1892ERROR: MixedArrayAccess - Civi/Api4/Generic/DAODeleteAction.php:54:20 - Cannot access array value on mixed variable $item
1893 $bao->id = $item['id'];
1894
1895
1896ERROR: MixedAssignment - Civi/Api4/Generic/DAODeleteAction.php:56:9 - Cannot assign $action_result to a mixed type
1897 $action_result = $bao->delete();
1898
1899
1900ERROR: MixedMethodCall - Civi/Api4/Generic/DAODeleteAction.php:56:32 - Cannot determine the type of the object on the left hand side of this expression
1901 $action_result = $bao->delete();
1902
1903
1904ERROR: InvalidThrow - Civi/Api4/Generic/DAODeleteAction.php:61:11 - Cannot throw API_Exception as it does not extend Exception or implement Throwable
1905 throw new \API_Exception("Could not delete {$this->getEntityName()} id {$item['id']}");
1906
1907
1908ERROR: UndefinedClass - Civi/Api4/Generic/DAODeleteAction.php:61:21 - Class or interface API_Exception does not exist
1909 throw new \API_Exception("Could not delete {$this->getEntityName()} id {$item['id']}");
1910
1911
1912ERROR: MissingReturnType - Civi/Api4/Generic/DAOGetAction.php:15:19 - Method Civi\Api4\Generic\DAOGetAction::_run does not have a return type, expecting void
1913 public function _run(Result $result) {
1914
1915
1916ERROR: MixedInferredReturnType - Civi/Api4/Generic/DAOGetFieldsAction.php:26:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\DAOGetFieldsAction::getRecords
1917 /**
1918 * Get fields for a DAO-based entity
1919 *
1920 * @return array
1921 */
1922 protected function getRecords() {
1923 $fields = $this->_itemsToGet('name');
1924 /** @var SpecGatherer $gatherer */
1925 $gatherer = \Civi::container()->get('spec_gatherer');
1926
1927
1928ERROR: UndefinedClass - Civi/Api4/Generic/DAOGetFieldsAction.php:31:17 - Class or interface Civi does not exist
1929 $gatherer = \Civi::container()->get('spec_gatherer');
1930
1931
1932ERROR: MissingReturnType - Civi/Api4/Generic/DAOGetFieldsAction.php:40:19 - Method Civi\Api4\Generic\DAOGetFieldsAction::fields does not have a return type
1933 public function fields() {
1934
1935
1936ERROR: MixedAssignment - Civi/Api4/Generic/DAOGetFieldsAction.php:41:5 - Cannot assign $fields to a mixed type
1937 $fields = parent::fields();
1938
1939
1940ERROR: MissingReturnType - Civi/Api4/Generic/DAOUpdateAction.php:25:19 - Method Civi\Api4\Generic\DAOUpdateAction::_run does not have a return type, expecting void
1941 public function _run(Result $result) {
1942
1943
1944ERROR: MixedArrayAccess - Civi/Api4/Generic/DAOUpdateAction.php:32:17 - Cannot access array value on mixed variable $wheres['id']
1945 elseif (!($wheres['id'][1] === '=' && $wheres['id'][2] == $this->values['id'])) {
1946
1947
1948ERROR: MixedArrayAccess - Civi/Api4/Generic/DAOUpdateAction.php:32:45 - Cannot access array value on mixed variable $wheres['id']
1949 elseif (!($wheres['id'][1] === '=' && $wheres['id'][2] == $this->values['id'])) {
1950
1951
1952ERROR: UndefinedClass - Civi/Api4/Generic/DAOUpdateAction.php:39:17 - Class or interface API_Exception does not exist
1953 throw new \API_Exception('Parameter "where" is required unless an id is supplied in values.');
1954
1955
1956ERROR: MixedArrayAccess - Civi/Api4/Generic/DAOUpdateAction.php:43:71 - Cannot access array value on mixed variable $this->where[0]
1957 if ($this->getSelect() === ['id'] && count($this->where) === 1 && $this->where[0][0] === 'id' && $this->where[0][1] === '=' && !empty($this->where[0][2])) {
1958
1959
1960ERROR: MixedArrayAccess - Civi/Api4/Generic/DAOUpdateAction.php:43:102 - Cannot access array value on mixed variable $this->where[0]
1961 if ($this->getSelect() === ['id'] && count($this->where) === 1 && $this->where[0][0] === 'id' && $this->where[0][1] === '=' && !empty($this->where[0][2])) {
1962
1963
1964ERROR: MixedArrayAccess - Civi/Api4/Generic/DAOUpdateAction.php:44:29 - Cannot access array value on mixed variable $this->where[0]
1965 $this->values['id'] = $this->where[0][2];
1966
1967
1968ERROR: PossiblyInvalidIterator - Civi/Api4/Generic/DAOUpdateAction.php:51:14 - Cannot iterate over int
1969 foreach ($items as &$item) {
1970
1971
1972ERROR: MissingConstructor - Civi/Api4/Generic/Result.php:37:10 - Civi\Api4\Result\ReplaceResult has an uninitialized variable $this->entity, but no constructor
1973 public $entity;
1974
1975
1976ERROR: MissingPropertyType - Civi/Api4/Generic/Result.php:48:11 - Property Civi\Api4\Generic\Result::$indexedBy does not have a declared type - consider null|string
1977 private $indexedBy;
1978
1979
1980ERROR: MixedInferredReturnType - Civi/Api4/Generic/Result.php:52:14 - Could not verify return type 'array<array-key, mixed>|null' for Civi\Api4\Generic\Result::first
1981 /**
1982 * Return first result.
1983 * @return array|null
1984 */
1985 public function first() {
1986 foreach ($this as $values) {
1987 return $values;
1988 }
1989 return NULL;
1990 }
1991
1992
1993ERROR: MixedAssignment - Civi/Api4/Generic/Result.php:55:23 - Cannot assign $values to a mixed type
1994 foreach ($this as $values) {
1995
1996
1997ERROR: MixedReturnStatement - Civi/Api4/Generic/Result.php:56:14 - Could not infer a return type
1998 return $values;
1999
2000
2001ERROR: MixedInferredReturnType - Civi/Api4/Generic/Result.php:63:14 - Could not verify return type 'array<array-key, mixed>|null' for Civi\Api4\Generic\Result::last
2002 /**
2003 * Return last result.
2004 * @return array|null
2005 */
2006 public function last() {
2007 $items = $this->getArrayCopy();
2008 return array_pop($items);
2009 }
2010
2011
2012ERROR: MixedReturnStatement - Civi/Api4/Generic/Result.php:67:12 - Could not infer a return type
2013 return array_pop($items);
2014
2015
2016ERROR: MixedInferredReturnType - Civi/Api4/Generic/Result.php:72:14 - Could not verify return type 'array<array-key, mixed>|null' for Civi\Api4\Generic\Result::itemAt
2017 /**
2018 * @param int $index
2019 * @return array|null
2020 */
2021 public function itemAt($index) {
2022 $length = $index < 0 ? 0 - $index : $index + 1;
2023 if ($length > count($this)) {
2024 return NULL;
2025 }
2026
2027
2028ERROR: MixedReturnStatement - Civi/Api4/Generic/Result.php:79:12 - Could not infer a return type
2029 return array_slice(array_values($this->getArrayCopy()), $index, 1)[0];
2030
2031
2032ERROR: MixedAssignment - Civi/Api4/Generic/Result.php:95:25 - Cannot assign $values to a mixed type
2033 foreach ($this as $values) {
2034
2035
2036ERROR: MixedArrayOffset - Civi/Api4/Generic/Result.php:97:11 - Cannot access value on variable $newResults[mixed] using mixed offset
2037 $newResults[$values[$key]] = $values;
2038
2039
2040ERROR: MixedAssignment - Civi/Api4/Generic/Result.php:97:11 - Cannot assign to a mixed type
2041 $newResults[$values[$key]] = $values;
2042
2043
2044ERROR: MixedArrayAccess - Civi/Api4/Generic/Result.php:97:23 - Cannot access array value on mixed variable $values
2045 $newResults[$values[$key]] = $values;
2046
2047
2048ERROR: UndefinedClass - Civi/Api4/Generic/Result.php:101:19 - Class or interface API_Exception does not exist
2049 throw new \API_Exception("Key $key not found in api results");
2050
2051
2052ERROR: MixedInferredReturnType - Civi/Api4/Generic/Result.php:111:14 - Could not verify return type 'int' for Civi\Api4\Generic\Result::count
2053 /**
2054 * Returns the number of results
2055 *
2056 * @return int
2057 */
2058 public function count() {
2059 $count = parent::count();
2060 if ($count == 1 && is_array($this->first()) && array_keys($this->first()) == ['row_count']) {
2061
2062
2063ERROR: PossiblyNullArgument - Civi/Api4/Generic/Result.php:115:63 - Argument 1 of array_keys cannot be null, possibly null value provided
2064 if ($count == 1 && is_array($this->first()) && array_keys($this->first()) == ['row_count']) {
2065
2066
2067ERROR: PossiblyNullArrayAccess - Civi/Api4/Generic/Result.php:116:14 - Cannot access array value on possibly null variable of type array<array-key, mixed>|null
2068 return $this->first()['row_count'];
2069
2070
2071ERROR: MixedReturnStatement - Civi/Api4/Generic/Result.php:116:14 - Could not infer a return type
2072 return $this->first()['row_count'];
2073
2074
2075ERROR: MissingParamType - Civi/Api4/Generic/Result.php:127:26 - Parameter $name has no provided type
2076 public function column($name) {
2077
2078
2079ERROR: MixedAssignment - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:59:33 - Cannot assign $filter to a mixed type
2080 foreach ($filters[1] as $filter) {
2081
2082
2083ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:60:41 - Argument 2 of Civi\Api4\Generic\BasicGetAction::walkfilters cannot be mixed, expecting array<array-key, mixed>
2084 if (!$this->walkFilters($row, $filter)) {
2085
2086
2087ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:68:26 - Argument 1 of count cannot be mixed, expecting array<array-key, mixed>|Countable
2088 $result = !count($filters[1]);
2089
2090
2091ERROR: MixedAssignment - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:69:33 - Cannot assign $filter to a mixed type
2092 foreach ($filters[1] as $filter) {
2093
2094
2095ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:70:40 - Argument 2 of Civi\Api4\Generic\BasicGetAction::walkfilters cannot be mixed, expecting array<array-key, mixed>
2096 if ($this->walkFilters($row, $filter)) {
2097
2098
2099ERROR: DocblockTypeContradiction - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:88:10 - Found a contradiction with a docblock-defined type when evaluating $condition and trying to reconcile type 'array<array-key, mixed>' to !array
2100 if (!is_array($condition)) {
2101
2102
2103ERROR: DocblockTypeContradiction - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:88:10 - Found a contradiction with a docblock-defined type when evaluating $condition and trying to reconcile type 'array<array-key, mixed>' to !array
2104 if (!is_array($condition)) {
2105
2106
2107ERROR: UndefinedClass - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:89:17 - Class or interface Civi\API\Exception\NotImplementedException does not exist
2108 throw new NotImplementedException('Unexpected where syntax; expecting array.');
2109
2110
2111ERROR: MixedAssignment - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:91:5 - Cannot assign $value to a mixed type
2112 $value = isset($row[$condition[0]]) ? $row[$condition[0]] : NULL;
2113
2114
2115ERROR: MixedArrayOffset - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:91:20 - Cannot access value on variable $row using mixed offset
2116 $value = isset($row[$condition[0]]) ? $row[$condition[0]] : NULL;
2117
2118
2119ERROR: MixedArrayOffset - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:91:43 - Cannot access value on variable $row using mixed offset
2120 $value = isset($row[$condition[0]]) ? $row[$condition[0]] : NULL;
2121
2122
2123ERROR: MixedAssignment - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:92:5 - Cannot assign $operator to a mixed type
2124 $operator = $condition[1];
2125
2126
2127ERROR: MixedAssignment - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:93:5 - Cannot assign $expected to a mixed type
2128 $expected = isset($condition[2]) ? $condition[2] : NULL;
2129
2130
2131ERROR: MixedArrayAccess - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:127:31 - Cannot access array value on mixed variable $expected
2132 $between = ($value >= $expected[0] && $value <= $expected[1]);
2133
2134
2135ERROR: MixedArrayAccess - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:127:57 - Cannot access array value on mixed variable $expected
2136 $between = ($value >= $expected[0] && $value <= $expected[1]);
2137
2138
2139ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:132:61 - Argument 1 of preg_quote cannot be mixed, expecting string
2140 $pattern = '/^' . str_replace('%', '.*', preg_quote($expected, '/')) . '$/i';
2141
2142
2143ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:133:38 - Argument 2 of preg_match cannot be mixed, expecting string
2144 return !preg_match($pattern, $value) == ($operator != 'LIKE');
2145
2146
2147ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:136:33 - Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed>
2148 return in_array($value, $expected);
2149
2150
2151ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:139:34 - Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed>
2152 return !in_array($value, $expected);
2153
2154
2155ERROR: UndefinedClass - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:142:19 - Class or interface Civi\API\Exception\NotImplementedException does not exist
2156 throw new NotImplementedException("Unsupported operator: '$operator' cannot be used with array data");
2157
2158
2159ERROR: MixedInferredReturnType - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:148:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\Traits\ArrayQueryActionTrait::sortArray
2160 /**
2161 * @param $values
2162 * @return array
2163 */
2164 protected function sortArray($values) {
2165 if ($this->getOrderBy()) {
2166 usort($values, [$this, 'sortCompare']);
2167 }
2168 return $values;
2169 }
2170
2171
2172ERROR: MissingParamType - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:150:32 - Parameter $values has no provided type
2173 protected function sortArray($values) {
2174
2175
2176ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:152:13 - Argument 1 of usort cannot be mixed, expecting array<mixed, mixed>
2177 usort($values, [$this, 'sortCompare']);
2178
2179
2180ERROR: MissingReturnType - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:157:20 - Method Civi\Api4\Generic\Traits\ArrayQueryActionTrait::sortCompare does not have a return type, expecting int
2181 private function sortCompare($a, $b) {
2182
2183
2184ERROR: MissingParamType - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:157:32 - Parameter $a has no provided type
2185 private function sortCompare($a, $b) {
2186
2187
2188ERROR: MissingParamType - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:157:36 - Parameter $b has no provided type
2189 private function sortCompare($a, $b) {
2190
2191
2192ERROR: MixedAssignment - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:158:47 - Cannot assign $dir to a mixed type
2193 foreach ($this->getOrderBy() as $field => $dir) {
2194
2195
2196ERROR: MixedArrayAccess - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:161:27 - Cannot access array value on mixed variable $b
2197 if ($a[$field] == $b[$field]) {
2198
2199
2200ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:164:31 - Argument 1 of strnatcasecmp cannot be mixed, expecting string
2201 return (strnatcasecmp($a[$field], $b[$field]) * $modifier);
2202
2203
2204ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:164:43 - Argument 2 of strnatcasecmp cannot be mixed, expecting string
2205 return (strnatcasecmp($a[$field], $b[$field]) * $modifier);
2206
2207
2208ERROR: MixedInferredReturnType - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:175:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\Traits\ArrayQueryActionTrait::selectArray
2209 /**
2210 * @param $values
2211 * @return array
2212 */
2213 protected function selectArray($values) {
2214 if ($this->getSelect() === ['row_count']) {
2215 $values = [['row_count' => count($values)]];
2216 }
2217 elseif ($this->getSelect()) {
2218
2219
2220ERROR: MissingParamType - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:177:34 - Parameter $values has no provided type
2221 protected function selectArray($values) {
2222
2223
2224ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:179:40 - Argument 1 of count cannot be mixed, expecting array<array-key, mixed>|Countable
2225 $values = [['row_count' => count($values)]];
2226
2227
2228ERROR: MixedAssignment - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:182:28 - Cannot assign $value to a mixed type
2229 foreach ($values as &$value) {
2230
2231
2232ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:183:38 - Argument 1 of array_intersect_key cannot be mixed, expecting array<array-key, mixed>
2233 $value = array_intersect_key($value, array_flip($this->getSelect()));
2234
2235
2236ERROR: MixedInferredReturnType - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:191:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\Traits\ArrayQueryActionTrait::limitArray
2237 /**
2238 * @param $values
2239 * @return array
2240 */
2241 protected function limitArray($values) {
2242 if ($this->getOffset() || $this->getLimit()) {
2243 $values = array_slice($values, $this->getOffset() ?: 0, $this->getLimit() ?: NULL);
2244 }
2245
2246
2247ERROR: MissingParamType - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:193:33 - Parameter $values has no provided type
2248 protected function limitArray($values) {
2249
2250
2251ERROR: MixedArgument - Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php:195:29 - Argument 1 of array_slice cannot be mixed, expecting array<array-key, mixed>
2252 $values = array_slice($values, $this->getOffset() ?: 0, $this->getLimit() ?: NULL);
2253
2254
2255ERROR: MissingParamType - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:15:31 - Parameter $customGroup has no provided type
2256 public function __construct($customGroup, $actionName) {
2257
2258
2259ERROR: MissingParamType - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:15:45 - Parameter $actionName has no provided type
2260 public function __construct($customGroup, $actionName) {
2261
2262
2263ERROR: MixedAssignment - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:16:5 - Cannot assign $this->customGroup to a mixed type
2264 $this->customGroup = $customGroup;
2265
2266
2267ERROR: TooManyArguments - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:17:5 - Too many arguments for method Civi\Api4\Generic\DAOCreateAction::__construct - expecting 2 but saw 3
2268 parent::__construct('CustomValue', $actionName, ['id', 'entity_id']);
2269
2270
2271ERROR: MixedArgument - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:17:40 - Argument 2 of Civi\Api4\Generic\DAOGetFieldsAction::__construct cannot be mixed, expecting string
2272 parent::__construct('CustomValue', $actionName, ['id', 'entity_id']);
2273
2274
2275ERROR: InvalidArgument - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:17:53 - Argument 3 of Civi\Api4\Generic\DAOGetFieldsAction::__construct expects callable|null, array{0:string(id), 1:string(entity_id)} provided
2276 parent::__construct('CustomValue', $actionName, ['id', 'entity_id']);
2277
2278
2279ERROR: MissingReturnType - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:37:22 - Method Civi\Api4\Generic\Traits\CustomValueActionTrait::writeObjects does not have a return type, expecting array<int, mixed>
2280 protected function writeObjects($items) {
2281
2282
2283ERROR: MissingParamType - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:37:35 - Parameter $items has no provided type
2284 protected function writeObjects($items) {
2285
2286
2287ERROR: MixedAssignment - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:40:24 - Cannot assign $item to a mixed type
2288 foreach ($items as $item) {
2289
2290
2291ERROR: MixedAssignment - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:44:36 - Cannot assign $field to a mixed type
2292 foreach ($fields as $name => $field) {
2293
2294
2295ERROR: MixedAssignment - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:46:11 - Cannot assign to a mixed type
2296 $item['custom_' . $field['custom_field_id']] = $item[$name];
2297
2298
2299ERROR: MixedOperand - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:46:29 - Right operand cannot be mixed
2300 $item['custom_' . $field['custom_field_id']] = $item[$name];
2301
2302
2303ERROR: MixedArrayAccess - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:46:58 - Cannot access array value on mixed variable $item
2304 $item['custom_' . $field['custom_field_id']] = $item[$name];
2305
2306
2307ERROR: MixedAssignment - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:51:7 - Cannot assign to a mixed type
2308 $result[] = \CRM_Core_BAO_CustomValueTable::setValues($item);
2309
2310
2311ERROR: UndefinedClass - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:51:19 - Class or interface CRM_Core_BAO_CustomValueTable does not exist
2312 $result[] = \CRM_Core_BAO_CustomValueTable::setValues($item);
2313
2314
2315ERROR: MissingReturnType - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:59:22 - Method Civi\Api4\Generic\Traits\CustomValueActionTrait::deleteObjects does not have a return type, expecting array<int, mixed>
2316 protected function deleteObjects($items) {
2317
2318
2319ERROR: MissingParamType - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:59:36 - Parameter $items has no provided type
2320 protected function deleteObjects($items) {
2321
2322
2323ERROR: MixedAssignment - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:62:24 - Cannot assign $item to a mixed type
2324 foreach ($items as $item) {
2325
2326
2327ERROR: UndefinedClass - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:63:7 - Class or interface CRM_Utils_Hook does not exist
2328 \CRM_Utils_Hook::pre('delete', $this->getEntityName(), $item['id'], \CRM_Core_DAO::$_nullArray);
2329
2330
2331ERROR: UndefinedClass - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:64:7 - Class or interface CRM_Utils_SQL_Delete does not exist
2332 \CRM_Utils_SQL_Delete::from($customTable)
2333
2334
2335ERROR: MixedMethodCall - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:65:11 - Cannot determine the type of the object on the left hand side of this expression
2336 ->where('id = #value')
2337
2338
2339ERROR: MixedMethodCall - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:66:11 - Cannot determine the type of the object on the left hand side of this expression
2340 ->param('#value', $item['id'])
2341
2342
2343ERROR: MixedArrayAccess - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:66:27 - Cannot access array value on mixed variable $item
2344 ->param('#value', $item['id'])
2345
2346
2347ERROR: MixedMethodCall - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:67:11 - Cannot determine the type of the object on the left hand side of this expression
2348 ->execute();
2349
2350
2351ERROR: UndefinedClass - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:68:7 - Class or interface CRM_Utils_Hook does not exist
2352 \CRM_Utils_Hook::post('delete', $this->getEntityName(), $item['id'], \CRM_Core_DAO::$_nullArray);
2353
2354
2355ERROR: MixedAssignment - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:69:7 - Cannot assign to a mixed type
2356 $ids[] = $item['id'];
2357
2358
2359ERROR: MissingReturnType - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:77:22 - Method Civi\Api4\Generic\Traits\CustomValueActionTrait::fillDefaults does not have a return type, expecting void
2360 protected function fillDefaults(&$params) {
2361
2362
2363ERROR: MissingParamType - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:77:36 - Parameter $params has no provided type
2364 protected function fillDefaults(&$params) {
2365
2366
2367ERROR: MixedAssignment - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:78:48 - Cannot assign $field to a mixed type
2368 foreach ($this->entityFields() as $name => $field) {
2369
2370
2371ERROR: MixedAssignment - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:80:9 - Cannot assign to a mixed type
2372 $params[$name] = $field['default_value'];
2373
2374
2375ERROR: MixedArrayAccess - Civi/Api4/Generic/Traits/CustomValueActionTrait.php:80:26 - Cannot access array value on mixed variable $field
2376 $params[$name] = $field['default_value'];
2377
2378
2379ERROR: MixedInferredReturnType - Civi/Api4/Generic/Traits/DAOActionTrait.php:11:14 - Could not verify return type 'string|CRM_Core_DAO' for Civi\Api4\Generic\Traits\DAOActionTrait::getBaoName
2380 /**
2381 * @return \CRM_Core_DAO|string
2382 */
2383 protected function getBaoName() {
2384 require_once 'api/v3/utils.php';
2385 return \_civicrm_api3_get_BAO($this->getEntityName());
2386 }
2387
2388
2389ERROR: UndefinedDocblockClass - Civi/Api4/Generic/Traits/DAOActionTrait.php:11:14 - Docblock-defined class or interface CRM_Core_DAO does not exist
2390 /**
2391 * @return \CRM_Core_DAO|string
2392 */
2393 protected function getBaoName() {
2394 require_once 'api/v3/utils.php';
2395 return \_civicrm_api3_get_BAO($this->getEntityName());
2396 }
2397
2398
2399ERROR: MissingFile - Civi/Api4/Generic/Traits/DAOActionTrait.php:14:5 - Cannot find file /home/coolife/git-repos/gsoc/api/api/v3/utils.php to include
2400 require_once 'api/v3/utils.php';
2401
2402
2403ERROR: MixedAssignment - Civi/Api4/Generic/Traits/DAOActionTrait.php:26:5 - Cannot assign $fields to a mixed type
2404 $fields = $bao->fields();
2405
2406
2407ERROR: MixedMethodCall - Civi/Api4/Generic/Traits/DAOActionTrait.php:26:21 - Cannot determine the type of the object on the left hand side of this expression
2408 $fields = $bao->fields();
2409
2410
2411ERROR: MixedAssignment - Civi/Api4/Generic/Traits/DAOActionTrait.php:28:33 - Cannot assign $field to a mixed type
2412 foreach ($fields as $key => $field) {
2413
2414
2415ERROR: MixedAssignment - Civi/Api4/Generic/Traits/DAOActionTrait.php:29:7 - Cannot assign $name to a mixed type
2416 $name = $field['name'];
2417
2418
2419ERROR: MixedArrayAccess - Civi/Api4/Generic/Traits/DAOActionTrait.php:29:15 - Cannot access array value on mixed variable $field
2420 $name = $field['name'];
2421
2422
2423ERROR: MixedArgument - Civi/Api4/Generic/Traits/DAOActionTrait.php:30:33 - Argument 2 of property_exists cannot be mixed, expecting string
2424 if (property_exists($bao, $name)) {
2425
2426
2427ERROR: MixedAssignment - Civi/Api4/Generic/Traits/DAOActionTrait.php:31:9 - Cannot assign to a mixed type
2428 $values[$name] = $bao->$name;
2429
2430
2431ERROR: MixedArrayOffset - Civi/Api4/Generic/Traits/DAOActionTrait.php:31:9 - Cannot access value on variable $values[$name] using mixed offset
2432 $values[$name] = $bao->$name;
2433
2434
2435ERROR: MixedInferredReturnType - Civi/Api4/Generic/Traits/DAOActionTrait.php:38:14 - Could not verify return type 'array<array-key, mixed>|int' for Civi\Api4\Generic\Traits\DAOActionTrait::getObjects
2436 /**
2437 * @return array|int
2438 */
2439 protected function getObjects() {
2440 $query = new Api4SelectQuery($this->getEntityName(), $this->getCheckPermissions());
2441 $query->select = $this->getSelect();
2442
2443
2444ERROR: MissingDependency - Civi/Api4/Generic/Traits/DAOActionTrait.php:41:18 - Civi\Api4\Query\Api4SelectQuery depends on class or interface civi\api\selectquery that does not exist
2445 $query = new Api4SelectQuery($this->getEntityName(), $this->getCheckPermissions());
2446
2447
2448ERROR: MixedInferredReturnType - Civi/Api4/Generic/Traits/DAOActionTrait.php:55:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Generic\Traits\DAOActionTrait::writeObjects
2449 /**
2450 * Write bao objects as part of a create/update action.
2451 *
2452 * @param array $items
2453 * The records to write to the DB.
2454 * @return array
2455 * The records after being written to the DB (e.g. including newly assigned "id").
2456 * @throws \API_Exception
2457 */
2458 protected function writeObjects($items) {
2459
2460
2461ERROR: UndefinedClass - Civi/Api4/Generic/Traits/DAOActionTrait.php:69:15 - Class or interface CRM_Utils_Array does not exist
2462 $method = UtilsArray::value($this->getEntityName(), $oddballs, 'create');
2463
2464
2465ERROR: MissingParamType - Civi/Api4/Generic/Traits/DAOActionTrait.php:128:40 - Parameter $params has no provided type
2466 private function genericCreateMethod($params) {
2467
2468
2469ERROR: UndefinedClass - Civi/Api4/Generic/Traits/DAOActionTrait.php:132:5 - Class or interface CRM_Utils_Hook does not exist
2470 \CRM_Utils_Hook::pre($hook, $this->getEntityName(), UtilsArray::value('id', $params), $params);
2471
2472
2473ERROR: InvalidReturnType - Civi/Api4/Generic/Traits/DAOActionTrait.php:145:14 - No return statements were found for method Civi\Api4\Generic\Traits\DAOActionTrait::formatCustomParams but return type 'mixed' was expected
2474 /**
2475 * @param array $params
2476 * @param int $entityId
2477 * @return mixed
2478 */
2479 private function formatCustomParams(&$params, $entityId) {
2480 $customParams = [];
2481
2482 // $customValueID is the ID of the custom value in the custom table for this
2483
2484
2485ERROR: MixedAssignment - Civi/Api4/Generic/Traits/DAOActionTrait.php:152:34 - Cannot assign $value to a mixed type
2486 foreach ($params as $name => $value) {
2487
2488
2489ERROR: MixedArgumentTypeCoercion - Civi/Api4/Generic/Traits/DAOActionTrait.php:153:18 - Argument 1 of strpos expects string, parent type array-key provided
2490 if (strpos($name, '.') === FALSE) {
2491
2492
2493ERROR: MixedArgumentTypeCoercion - Civi/Api4/Generic/Traits/DAOActionTrait.php:157:55 - Argument 2 of explode expects string, parent type array-key provided
2494 list($customGroup, $customField) = explode('.', $name);
2495
2496
2497ERROR: MixedAssignment - Civi/Api4/Generic/Traits/DAOActionTrait.php:159:7 - Cannot assign $customFieldId to a mixed type
2498 $customFieldId = \CRM_Core_BAO_CustomField::getFieldValue(
2499
2500
2501ERROR: UndefinedClass - Civi/Api4/Generic/Traits/DAOActionTrait.php:159:24 - Class or interface CRM_Core_BAO_CustomField does not exist
2502 $customFieldId = \CRM_Core_BAO_CustomField::getFieldValue(
2503
2504
2505ERROR: MixedAssignment - Civi/Api4/Generic/Traits/DAOActionTrait.php:165:7 - Cannot assign $customFieldType to a mixed type
2506 $customFieldType = \CRM_Core_BAO_CustomField::getFieldValue(
2507
2508
2509ERROR: UndefinedClass - Civi/Api4/Generic/Traits/DAOActionTrait.php:165:26 - Class or interface CRM_Core_BAO_CustomField does not exist
2510 $customFieldType = \CRM_Core_BAO_CustomField::getFieldValue(
2511
2512
2513ERROR: MixedAssignment - Civi/Api4/Generic/Traits/DAOActionTrait.php:171:7 - Cannot assign $customFieldExtends to a mixed type
2514 $customFieldExtends = \CRM_Core_BAO_CustomGroup::getFieldValue(
2515
2516
2517ERROR: UndefinedClass - Civi/Api4/Generic/Traits/DAOActionTrait.php:171:29 - Class or interface CRM_Core_BAO_CustomGroup does not exist
2518 $customFieldExtends = \CRM_Core_BAO_CustomGroup::getFieldValue(
2519
2520
2521ERROR: UndefinedFunction - Civi/Api4/Generic/Traits/DAOActionTrait.php:183:11 - Function Civi\Api4\Generic\Traits\formatCheckBoxField does not exist
2522 formatCheckBoxField($value, 'custom_' . $customFieldId, $this->getEntityName());
2523
2524
2525ERROR: TypeDoesNotContainType - Civi/Api4/Generic/Traits/DAOActionTrait.php:200:9 - Found a contradiction when evaluating $customParams and trying to reconcile type 'array<empty, empty>' to !falsy
2526 if ($customParams) {
2527
2528
2529ERROR: TypeDoesNotContainType - Civi/Api4/Generic/Traits/DAOActionTrait.php:200:9 - Found a contradiction when evaluating $customParams and trying to reconcile type 'array<empty, empty>' to !falsy
2530 if ($customParams) {
2531
2532
2533ERROR: TypeDoesNotContainType - Civi/Api4/Generic/Traits/DAOActionTrait.php:200:9 - Found a contradiction when evaluating $customParams and trying to reconcile type 'array<empty, empty>' to !falsy
2534 if ($customParams) {
2535
2536
2537ERROR: TypeDoesNotContainType - Civi/Api4/Generic/Traits/DAOActionTrait.php:200:9 - Found a contradiction when evaluating $customParams and trying to reconcile type 'array<empty, empty>' to !falsy
2538 if ($customParams) {
2539
2540
2541ERROR: UndefinedClass - Civi/Api4/Provider/ActionObjectProvider.php:41:39 - Class or interface Symfony\Component\EventDispatcher\EventSubscriberInterface does not exist
2542class ActionObjectProvider implements EventSubscriberInterface, ProviderInterface {
2543
2544
2545ERROR: UndefinedClass - Civi/Api4/Query/Api4SelectQuery.php:54:31 - Class or interface Civi\API\SelectQuery does not exist
2546class Api4SelectQuery extends SelectQuery {
2547
2548
2549ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/Joinable/ActivityToActivityContactAssigneesJoinable.php:5:7 - Property Civi\Api4\Service\Schema\Joinable\Joinable::$alias is not defined in constructor of Civi\Api4\Service\Schema\Joinable\ActivityToActivityContactAssigneesJoinable or in any methods called in the constructor
2550class ActivityToActivityContactAssigneesJoinable extends Joinable {
2551
2552
2553ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/ActivityToActivityContactAssigneesJoinable.php:19:31 - Parameter $alias has no provided type
2554 public function __construct($alias) {
2555
2556
2557ERROR: MixedArgument - Civi/Api4/Service/Schema/Joinable/ActivityToActivityContactAssigneesJoinable.php:36:61 - Argument 2 of sprintf cannot be mixed, expecting string|int|float
2558 $this->addCondition(sprintf('%s.record_type_id = (%s)', $alias, $subSelect));
2559
2560
2561ERROR: MixedArgument - Civi/Api4/Service/Schema/Joinable/ActivityToActivityContactAssigneesJoinable.php:37:68 - Argument 3 of Civi\Api4\Service\Schema\Joinable\Joinable::__construct cannot be mixed, expecting string|null
2562 parent::__construct('civicrm_activity_contact', 'activity_id', $alias);
2563
2564
2565ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/Joinable/BridgeJoinable.php:5:7 - Property Civi\Api4\Service\Schema\Joinable\Joinable::$baseTable is not defined in constructor of Civi\Api4\Service\Schema\Joinable\BridgeJoinable or in any methods called in the constructor
2566class BridgeJoinable extends Joinable {
2567
2568
2569ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/BridgeJoinable.php:11:31 - Parameter $targetTable has no provided type
2570 public function __construct($targetTable, $targetColumn, $alias, Joinable $middleLink) {
2571
2572
2573ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/BridgeJoinable.php:11:45 - Parameter $targetColumn has no provided type
2574 public function __construct($targetTable, $targetColumn, $alias, Joinable $middleLink) {
2575
2576
2577ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/BridgeJoinable.php:11:60 - Parameter $alias has no provided type
2578 public function __construct($targetTable, $targetColumn, $alias, Joinable $middleLink) {
2579
2580
2581ERROR: MixedArgument - Civi/Api4/Service/Schema/Joinable/BridgeJoinable.php:12:54 - Argument 3 of Civi\Api4\Service\Schema\Joinable\Joinable::__construct cannot be mixed, expecting string|null
2582 parent::__construct($targetTable, $targetColumn, $alias);
2583
2584
2585ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:7:7 - Property Civi\Api4\Service\Schema\Joinable\Joinable::$baseTable is not defined in constructor of Civi\Api4\Service\Schema\Joinable\CustomGroupJoinable or in any methods called in the constructor
2586class CustomGroupJoinable extends Joinable {
2587
2588
2589ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:27:31 - Parameter $targetTable has no provided type
2590 public function __construct($targetTable, $alias, $isMultiRecord, $entity, $columns) {
2591
2592
2593ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:27:45 - Parameter $alias has no provided type
2594 public function __construct($targetTable, $alias, $isMultiRecord, $entity, $columns) {
2595
2596
2597ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:27:78 - Parameter $columns has no provided type
2598 public function __construct($targetTable, $alias, $isMultiRecord, $entity, $columns) {
2599
2600
2601ERROR: PossiblyNullPropertyAssignmentValue - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:28:21 - $this->entity with non-nullable declared type 'string' cannot be assigned nullable type 'null'
2602 $this->entity = $entity;
2603
2604
2605ERROR: MixedAssignment - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:29:5 - Cannot assign $this->columns to a mixed type
2606 $this->columns = $columns;
2607
2608
2609ERROR: MixedArgument - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:30:52 - Argument 3 of Civi\Api4\Service\Schema\Joinable\Joinable::__construct cannot be mixed, expecting string|null
2610 parent::__construct($targetTable, 'entity_id', $alias);
2611
2612
2613ERROR: InvalidPropertyAssignmentValue - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:31:23 - $this->joinType with declared type 'int' cannot be assigned type 'string(1_to_n)|string(1_to_1)'
2614 $this->joinType = $isMultiRecord ?
2615 self::JOIN_TYPE_ONE_TO_MANY : self::JOIN_TYPE_ONE_TO_ONE;
2616
2617
2618ERROR: MixedReturnTypeCoercion - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:38:19 - The declared return type 'array<array-key, Civi\Api4\Service\Spec\FieldSpec>' for Civi\Api4\Service\Schema\Joinable\CustomGroupJoinable::getEntityFields is more specific than the inferred return type 'array<array-key, mixed|Civi\Api4\Service\Spec\FieldSpec>'
2619 public function getEntityFields() {
2620
2621
2622ERROR: MixedAssignment - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:44:27 - Cannot assign $field to a mixed type
2623 foreach ($fields as $field) {
2624
2625
2626ERROR: MixedArgument - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:45:85 - Argument 1 of Civi\Api4\Service\Spec\SpecFormatter::arraytofield cannot be mixed, expecting array<array-key, mixed>
2627 $this->entityFields[] = \Civi\Api4\Service\Spec\SpecFormatter::arrayToField($field, $this->getEntity());
2628
2629
2630ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:54:28 - Parameter $fieldName has no provided type
2631 public function getField($fieldName) {
2632
2633
2634ERROR: MixedOperand - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:57:56 - Right operand cannot be mixed
2635 if ($name === $fieldName || strrpos($name, '.' . $fieldName) === strlen($name) - strlen($fieldName) - 1) {
2636
2637
2638ERROR: MixedArgument - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:57:95 - Argument 1 of strlen cannot be mixed, expecting string
2639 if ($name === $fieldName || strrpos($name, '.' . $fieldName) === strlen($name) - strlen($fieldName) - 1) {
2640
2641
2642ERROR: MixedInferredReturnType - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:65:14 - Could not verify return type 'string' for Civi\Api4\Service\Schema\Joinable\CustomGroupJoinable::getSqlColumn
2643 /**
2644 * @return string
2645 */
2646 public function getSqlColumn($fieldName) {
2647 return $this->columns[$fieldName];
2648 }
2649
2650
2651ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:67:32 - Parameter $fieldName has no provided type
2652 public function getSqlColumn($fieldName) {
2653
2654
2655ERROR: MixedArrayOffset - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:68:12 - Cannot access value on variable $this->columns using mixed offset
2656 return $this->columns[$fieldName];
2657
2658
2659ERROR: MixedReturnStatement - Civi/Api4/Service/Schema/Joinable/CustomGroupJoinable.php:68:12 - Could not infer a return type
2660 return $this->columns[$fieldName];
2661
2662
2663ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/Joinable/Joinable.php:20:13 - Property Civi\Api4\Service\Schema\Joinable\Joinable::$baseTable is not defined in constructor of Civi\Api4\Service\Schema\Joinable\Joinable or in any methods called in the constructor
2664 protected $baseTable;
2665
2666
2667ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/Joinable/Joinable.php:25:13 - Property Civi\Api4\Service\Schema\Joinable\Joinable::$baseColumn is not defined in constructor of Civi\Api4\Service\Schema\Joinable\Joinable or in any methods called in the constructor
2668 protected $baseColumn;
2669
2670
2671ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/Joinable/Joinable.php:42:13 - Property Civi\Api4\Service\Schema\Joinable\Joinable::$alias is not defined in constructor of Civi\Api4\Service\Schema\Joinable\Joinable or in any methods called in the constructor
2672 protected $alias;
2673
2674
2675ERROR: InvalidPropertyAssignmentValue - Civi/Api4/Service/Schema/Joinable/Joinable.php:57:25 - $this->joinType with declared type 'int' cannot be assigned type 'string(1_to_1)'
2676 protected $joinType = self::JOIN_TYPE_ONE_TO_ONE;
2677
2678
2679ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/Joinable/Joinable.php:62:13 - Property Civi\Api4\Service\Schema\Joinable\Joinable::$entity is not defined in constructor of Civi\Api4\Service\Schema\Joinable\Joinable or in any methods called in the constructor
2680 protected $entity;
2681
2682
2683ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/Joinable/Joinable.php:67:13 - Property Civi\Api4\Service\Schema\Joinable\Joinable::$entityFields is not defined in constructor of Civi\Api4\Service\Schema\Joinable\Joinable or in any methods called in the constructor
2684 protected $entityFields;
2685
2686
2687ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/Joinable.php:74:31 - Parameter $targetTable has no provided type
2688 public function __construct($targetTable, $targetColumn, $alias = NULL) {
2689
2690
2691ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/Joinable.php:74:45 - Parameter $targetColumn has no provided type
2692 public function __construct($targetTable, $targetColumn, $alias = NULL) {
2693
2694
2695ERROR: MixedAssignment - Civi/Api4/Service/Schema/Joinable/Joinable.php:75:5 - Cannot assign $this->targetTable to a mixed type
2696 $this->targetTable = $targetTable;
2697
2698
2699ERROR: MixedAssignment - Civi/Api4/Service/Schema/Joinable/Joinable.php:76:5 - Cannot assign $this->targetColumn to a mixed type
2700 $this->targetColumn = $targetColumn;
2701
2702
2703ERROR: UninitializedProperty - Civi/Api4/Service/Schema/Joinable/Joinable.php:77:10 - Cannot use uninitialized property $this->entity
2704 if (!$this->entity) {
2705
2706
2707ERROR: UndefinedClass - Civi/Api4/Service/Schema/Joinable/Joinable.php:78:23 - Class or interface CRM_Core_DAO_AllCoreTables does not exist
2708 $this->entity = Tables::getBriefName(Tables::getClassForTable($targetTable));
2709
2710
2711ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/Joinable.php:183:32 - Parameter $condition has no provided type
2712 public function addCondition($condition) {
2713
2714
2715ERROR: MixedInferredReturnType - Civi/Api4/Service/Schema/Joinable/Joinable.php:251:14 - Could not verify return type 'array<array-key, Civi\Api4\Service\Spec\FieldSpec>' for Civi\Api4\Service\Schema\Joinable\Joinable::getEntityFields
2716 /**
2717 * @return \Civi\Api4\Service\Spec\FieldSpec[]
2718 */
2719 public function getEntityFields() {
2720 if (!$this->entityFields) {
2721 $bao = Tables::getClassForTable($this->getTargetTable());
2722 if ($bao) {
2723
2724
2725ERROR: UndefinedClass - Civi/Api4/Service/Schema/Joinable/Joinable.php:255:14 - Class or interface CRM_Core_DAO_AllCoreTables does not exist
2726 $bao = Tables::getClassForTable($this->getTargetTable());
2727
2728
2729ERROR: MissingParamType - Civi/Api4/Service/Schema/Joinable/Joinable.php:268:28 - Parameter $fieldName has no provided type
2730 public function getField($fieldName) {
2731
2732
2733ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/Joinable/OptionValueJoinable.php:5:7 - Property Civi\Api4\Service\Schema\Joinable\Joinable::$baseTable is not defined in constructor of Civi\Api4\Service\Schema\Joinable\OptionValueJoinable or in any methods called in the constructor
2734class OptionValueJoinable extends Joinable {
2735
2736
2737ERROR: PossiblyNullArgument - Civi/Api4/Service/Schema/Joinable/OptionValueJoinable.php:33:57 - Argument 2 of sprintf cannot be null, possibly null value provided
2738 $condition = sprintf('%s.option_group_id = (%s)', $alias, $subQuery);
2739
2740
2741ERROR: PossiblyNullArgument - Civi/Api4/Service/Schema/Joinable/OptionValueJoinable.php:36:55 - Argument 2 of sprintf cannot be null, possibly null value provided
2742 $condition = sprintf('%s.option_group_id = %d', $alias, $optionGroup);
2743
2744
2745ERROR: MixedAssignment - Civi/Api4/Service/Schema/Joinable/OptionValueJoinable.php:50:45 - Cannot assign $condition to a mixed type
2746 foreach ($this->conditions as $index => $condition) {
2747
2748
2749ERROR: MixedArgument - Civi/Api4/Service/Schema/Joinable/OptionValueJoinable.php:53:66 - Argument 3 of str_replace cannot be mixed, expecting array<array-key, mixed>|string
2750 $this->conditions[$index] = str_replace($search, $replace, $condition);
2751
2752
2753ERROR: MixedInferredReturnType - Civi/Api4/Service/Schema/Joiner.php:35:14 - Could not verify return type 'array<array-key, Civi\Api4\Service\Schema\Joinable\Joinable>' for Civi\Api4\Service\Schema\Joiner::join
2754 /**
2755 * @param Api4SelectQuery $query
2756 * The query object to do the joins on
2757 * @param string $joinPath
2758 * A path of aliases in dot notation, e.g. contact.phone
2759 * @param string $side
2760 * Can be LEFT or INNER
2761 *
2762 * @throws \Exception
2763 * @return Joinable[]
2764 * The path used to make the join
2765 */
2766 public function join(Api4SelectQuery $query, $joinPath, $side = 'LEFT') {
2767 $fullPath = $this->getPath($query->getFrom(), $joinPath);
2768
2769
2770ERROR: MissingDependency - Civi/Api4/Service/Schema/Joiner.php:38:24 - Civi\Api4\Query\Api4SelectQuery depends on class or interface civi\api\selectquery that does not exist
2771 public function join(Api4SelectQuery $query, $joinPath, $side = 'LEFT') {
2772
2773
2774ERROR: MixedInferredReturnType - Civi/Api4/Service/Schema/Joiner.php:60:14 - Could not verify return type 'bool' for Civi\Api4\Service\Schema\Joiner::canJoin
2775 /**
2776 * @param Api4SelectQuery $query
2777 * @param $joinPath
2778 *
2779 * @return bool
2780 */
2781 public function canJoin(Api4SelectQuery $query, $joinPath) {
2782 return !empty($this->getPath($query->getFrom(), $joinPath));
2783 }
2784
2785
2786ERROR: MissingDependency - Civi/Api4/Service/Schema/Joiner.php:62:27 - Civi\Api4\Query\Api4SelectQuery depends on class or interface civi\api\selectquery that does not exist
2787 public function canJoin(Api4SelectQuery $query, $joinPath) {
2788
2789
2790ERROR: MissingParamType - Civi/Api4/Service/Schema/SchemaMap.php:24:27 - Parameter $baseTableName has no provided type
2791 public function getPath($baseTableName, $targetTableAlias) {
2792
2793
2794ERROR: MissingParamType - Civi/Api4/Service/Schema/SchemaMap.php:24:43 - Parameter $targetTableAlias has no provided type
2795 public function getPath($baseTableName, $targetTableAlias) {
2796
2797
2798ERROR: MixedArgument - Civi/Api4/Service/Schema/SchemaMap.php:32:30 - Argument 2 of Civi\Api4\Service\Schema\SchemaMap::findpaths cannot be mixed, expecting string
2799 $this->findPaths($table, $targetTableAlias, 1, $path);
2800
2801
2802ERROR: MixedArgumentTypeCoercion - Civi/Api4/Service/Schema/SchemaMap.php:36:40 - Argument 3 of array_slice expects null|int, parent type array-key provided
2803 $start = array_slice($path, 0, $index);
2804
2805
2806ERROR: MixedArgumentTypeCoercion - Civi/Api4/Service/Schema/SchemaMap.php:38:35 - Argument 2 of array_slice expects int, parent type array-key provided
2807 $end = array_slice($path, $index, count($path) - $index);
2808
2809
2810ERROR: MixedArgument - Civi/Api4/Service/Schema/SchemaMap.php:38:43 - Argument 3 of array_slice cannot be mixed, expecting null|int
2811 $end = array_slice($path, $index, count($path) - $index);
2812
2813
2814ERROR: InvalidOperand - Civi/Api4/Service/Schema/SchemaMap.php:38:58 - Cannot perform a numeric operation with a non-numeric type array-key
2815 $end = array_slice($path, $index, count($path) - $index);
2816
2817
2818ERROR: LoopInvalidation - Civi/Api4/Service/Schema/SchemaMap.php:39:9 - Variable $path has already been assigned in a for/foreach loop
2819 $path = array_merge($start, $middle, $end);
2820
2821
2822ERROR: MissingParamType - Civi/Api4/Service/Schema/SchemaMap.php:58:34 - Parameter $name has no provided type
2823 public function getTableByName($name) {
2824
2825
2826ERROR: MissingReturnType - Civi/Api4/Service/Schema/SchemaMap.php:86:19 - Method Civi\Api4\Service\Schema\SchemaMap::addTables does not have a return type, expecting void
2827 public function addTables(array $tables) {
2828
2829
2830ERROR: MixedAssignment - Civi/Api4/Service/Schema/SchemaMap.php:87:25 - Cannot assign $table to a mixed type
2831 foreach ($tables as $table) {
2832
2833
2834ERROR: MixedArgument - Civi/Api4/Service/Schema/SchemaMap.php:88:23 - Argument 1 of Civi\Api4\Service\Schema\SchemaMap::addtable cannot be mixed, expecting Civi\Api4\Service\Schema\Table
2835 $this->addTable($table);
2836
2837
2838ERROR: MissingReturnType - Civi/Api4/Service/Schema/SchemaMap.php:106:20 - Method Civi\Api4\Service\Schema\SchemaMap::findPaths does not have a return type, expecting void
2839 private function findPaths(Table $table, $target, $depth, &$path, $currentPath = []
2840
2841
2842ERROR: MixedArgument - Civi/Api4/Service/Schema/SchemaMap.php:117:45 - Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed>
2843 $beenHere = in_array($table->getName(), $visited);
2844
2845
2846ERROR: UndefinedDocblockClass - Civi/Api4/Service/Schema/SchemaMapBuilder.php:17:11 - Docblock-defined class or interface Symfony\Component\EventDispatcher\EventDispatcherInterface does not exist
2847 /**
2848 * @var EventDispatcherInterface
2849 */
2850 protected $dispatcher;
2851
2852
2853ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/SchemaMapBuilder.php:19:13 - Property Civi\Api4\Service\Schema\SchemaMapBuilder::$dispatcher is not defined in constructor of Civi\Api4\Service\Schema\SchemaMapBuilder or in any methods called in the constructor
2854 protected $dispatcher;
2855
2856
2857ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Schema/SchemaMapBuilder.php:23:13 - Property Civi\Api4\Service\Schema\SchemaMapBuilder::$apiEntities is not defined in constructor of Civi\Api4\Service\Schema\SchemaMapBuilder or in any methods called in the constructor
2858 protected $apiEntities;
2859
2860
2861ERROR: UndefinedClass - Civi/Api4/Service/Schema/SchemaMapBuilder.php:28:31 - Class or interface Symfony\Component\EventDispatcher\EventDispatcherInterface does not exist
2862 public function __construct(EventDispatcherInterface $dispatcher) {
2863
2864
2865ERROR: MixedInferredReturnType - Civi/Api4/Service/Schema/SchemaMapBuilder.php:34:14 - Could not verify return type 'Civi\Api4\Service\Schema\SchemaMap' for Civi\Api4\Service\Schema\SchemaMapBuilder::build
2866 /**
2867 * @return SchemaMap
2868 */
2869 public function build() {
2870 $map = new SchemaMap();
2871 $this->loadTables($map);
2872
2873 $event = new SchemaMapBuildEvent($map);
2874
2875
2876ERROR: MissingDependency - Civi/Api4/Service/Schema/SchemaMapBuilder.php:40:18 - Civi\Api4\Event\SchemaMapBuildEvent depends on class or interface symfony\component\eventdispatcher\event that does not exist
2877 $event = new SchemaMapBuildEvent($map);
2878
2879
2880ERROR: MissingReturnType - Civi/Api4/Service/Schema/SchemaMapBuilder.php:51:20 - Method Civi\Api4\Service\Schema\SchemaMapBuilder::loadTables does not have a return type, expecting void
2881 private function loadTables(SchemaMap $map) {
2882
2883
2884ERROR: UndefinedClass - Civi/Api4/Service/Schema/SchemaMapBuilder.php:53:14 - Class or interface CRM_Core_DAO_AllCoreTables does not exist
2885 foreach (TableHelper::get() as $daoName => $data) {
2886
2887
2888ERROR: MissingReturnType - Civi/Api4/Service/Schema/SchemaMapBuilder.php:72:20 - Method Civi\Api4\Service\Schema\SchemaMapBuilder::addJoins does not have a return type, expecting void
2889 private function addJoins(Table $table, $field, array $data) {
2890
2891
2892ERROR: UndefinedClass - Civi/Api4/Service/Schema/SchemaMapBuilder.php:73:16 - Class or interface CRM_Utils_Array does not exist
2893 $fkClass = UtilsArray::value('FKClassName', $data);
2894
2895
2896ERROR: MissingReturnType - Civi/Api4/Service/Schema/SchemaMapBuilder.php:94:20 - Method Civi\Api4\Service\Schema\SchemaMapBuilder::addPseudoConstantJoin does not have a return type, expecting void
2897 private function addPseudoConstantJoin(Table $table, $field, array $data) {
2898
2899
2900ERROR: UndefinedClass - Civi/Api4/Service/Schema/SchemaMapBuilder.php:95:23 - Class or interface CRM_Utils_Array does not exist
2901 $pseudoConstant = UtilsArray::value('pseudoconstant', $data);
2902
2903
2904ERROR: MissingReturnType - Civi/Api4/Service/Schema/SchemaMapBuilder.php:126:20 - Method Civi\Api4\Service\Schema\SchemaMapBuilder::addBackReferences does not have a return type, expecting void
2905 private function addBackReferences(SchemaMap $map) {
2906
2907
2908ERROR: MixedArgument - Civi/Api4/Service/Schema/SchemaMapBuilder.php:138:32 - Argument 1 of Civi\Api4\Service\Schema\Joinable\Joinable::setjointype cannot be mixed, expecting int
2909 $joinable->setJoinType($joinable::JOIN_TYPE_ONE_TO_MANY);
2910
2911
2912ERROR: PossiblyNullReference - Civi/Api4/Service/Schema/SchemaMapBuilder.php:139:18 - Cannot call method addTableLink on possibly null value
2913 $target->addTableLink($link->getTargetColumn(), $joinable);
2914
2915
2916ERROR: MissingReturnType - Civi/Api4/Service/Schema/SchemaMapBuilder.php:171:20 - Method Civi\Api4\Service\Schema\SchemaMapBuilder::addCustomFields does not have a return type, expecting void
2917 private function addCustomFields(SchemaMap $map, Table $baseTable, $entity) {
2918
2919
2920ERROR: UndefinedClass - Civi/Api4/Service/Schema/SchemaMapBuilder.php:173:36 - Class or interface CRM_Core_SelectValues does not exist
2921 if (!array_key_exists($entity, \CRM_Core_SelectValues::customGroupExtends())) {
2922
2923
2924ERROR: MixedArgument - Civi/Api4/Service/Schema/SchemaMapBuilder.php:173:36 - Argument 2 of array_key_exists cannot be mixed, expecting array<TKey, mixed>
2925 if (!array_key_exists($entity, \CRM_Core_SelectValues::customGroupExtends())) {
2926
2927
2928ERROR: UndefinedClass - Civi/Api4/Service/Schema/SchemaMapBuilder.php:180:18 - Class or interface CRM_Utils_SQL_Select does not exist
2929 $fieldData = \CRM_Utils_SQL_Select::from('civicrm_custom_field f')
2930
2931
2932ERROR: MissingParamType - Civi/Api4/Service/Schema/Table.php:23:31 - Parameter $name has no provided type
2933 public function __construct($name) {
2934
2935
2936ERROR: MixedAssignment - Civi/Api4/Service/Schema/Table.php:24:5 - Cannot assign $this->name to a mixed type
2937 $this->name = $name;
2938
2939
2940ERROR: MissingReturnType - Civi/Api4/Service/Schema/Table.php:65:19 - Method Civi\Api4\Service\Schema\Table::removeLink does not have a return type, expecting void
2941 public function removeLink(Joinable $linkToRemove) {
2942
2943
2944ERROR: MixedAssignment - Civi/Api4/Service/Schema/Table.php:103:5 - Cannot assign $this->tableLinks to a mixed type
2945 $this->tableLinks = $tableLinks;
2946
2947
2948ERROR: MissingParamType - Civi/Api4/Service/Schema/Table.php:115:28 - Parameter $target has no provided type
2949 private function hasLink($target, $targetCol, $alias) {
2950
2951
2952ERROR: MissingParamType - Civi/Api4/Service/Schema/Table.php:115:37 - Parameter $targetCol has no provided type
2953 private function hasLink($target, $targetCol, $alias) {
2954
2955
2956ERROR: MissingParamType - Civi/Api4/Service/Schema/Table.php:115:49 - Parameter $alias has no provided type
2957 private function hasLink($target, $targetCol, $alias) {
2958
2959
2960ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/CustomFieldSpec.php:5:7 - Property Civi\Api4\Service\Spec\FieldSpec::$title is not defined in constructor of Civi\Api4\Service\Spec\CustomFieldSpec or in any methods called in the constructor
2961class CustomFieldSpec extends FieldSpec {
2962
2963
2964ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/CustomFieldSpec.php:9:13 - Property Civi\Api4\Service\Spec\CustomFieldSpec::$customFieldId is not defined in constructor of Civi\Api4\Service\Spec\CustomFieldSpec or in any methods called in the constructor
2965 protected $customFieldId;
2966
2967
2968ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/CustomFieldSpec.php:14:13 - Property Civi\Api4\Service\Spec\CustomFieldSpec::$customGroup is not defined in constructor of Civi\Api4\Service\Spec\CustomFieldSpec or in any methods called in the constructor
2969 protected $customGroup;
2970
2971
2972ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/CustomFieldSpec.php:19:13 - Property Civi\Api4\Service\Spec\CustomFieldSpec::$tableName is not defined in constructor of Civi\Api4\Service\Spec\CustomFieldSpec or in any methods called in the constructor
2973 protected $tableName;
2974
2975
2976ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/CustomFieldSpec.php:24:13 - Property Civi\Api4\Service\Spec\CustomFieldSpec::$columnName is not defined in constructor of Civi\Api4\Service\Spec\CustomFieldSpec or in any methods called in the constructor
2977 protected $columnName;
2978
2979
2980ERROR: MissingParamType - Civi/Api4/Service/Spec/CustomFieldSpec.php:29:31 - Parameter $dataType has no provided type
2981 public function setDataType($dataType) {
2982
2983
2984ERROR: InvalidPropertyAssignmentValue - Civi/Api4/Service/Spec/CustomFieldSpec.php:77:26 - $this->customGroup with declared type 'int' cannot be assigned type 'string'
2985 $this->customGroup = $customGroupName;
2986
2987
2988ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/FieldSpec.php:21:13 - Property Civi\Api4\Service\Spec\FieldSpec::$title is not defined in constructor of Civi\Api4\Service\Spec\FieldSpec or in any methods called in the constructor
2989 protected $title;
2990
2991
2992ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/FieldSpec.php:31:13 - Property Civi\Api4\Service\Spec\FieldSpec::$description is not defined in constructor of Civi\Api4\Service\Spec\FieldSpec or in any methods called in the constructor
2993 protected $description;
2994
2995
2996ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/FieldSpec.php:41:13 - Property Civi\Api4\Service\Spec\FieldSpec::$requiredIf is not defined in constructor of Civi\Api4\Service\Spec\FieldSpec or in any methods called in the constructor
2997 protected $requiredIf;
2998
2999
3000ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/FieldSpec.php:46:13 - Property Civi\Api4\Service\Spec\FieldSpec::$options is not defined in constructor of Civi\Api4\Service\Spec\FieldSpec or in any methods called in the constructor
3001 protected $options;
3002
3003
3004ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/FieldSpec.php:56:13 - Property Civi\Api4\Service\Spec\FieldSpec::$fkEntity is not defined in constructor of Civi\Api4\Service\Spec\FieldSpec or in any methods called in the constructor
3005 protected $fkEntity;
3006
3007
3008ERROR: PropertyNotSetInConstructor - Civi/Api4/Service/Spec/FieldSpec.php:61:13 - Property Civi\Api4\Service\Spec\FieldSpec::$serialize is not defined in constructor of Civi\Api4\Service\Spec\FieldSpec or in any methods called in the constructor
3009 protected $serialize;
3010
3011
3012ERROR: InvalidDocblockParamName - Civi/Api4/Service/Spec/FieldSpec.php:190:18 - Incorrect param name $required in docblock for Civi\Api4\Service\Spec\FieldSpec::setRequiredIf
3013 /**
3014 * @param bool $required
3015 *
3016 * @return $this
3017 */
3018 public function setRequiredIf($requiredIf) {
3019
3020
3021ERROR: MissingParamType - Civi/Api4/Service/Spec/FieldSpec.php:194:33 - Parameter $requiredIf has no provided type
3022 public function setRequiredIf($requiredIf) {
3023
3024
3025ERROR: MixedAssignment - Civi/Api4/Service/Spec/FieldSpec.php:195:5 - Cannot assign $this->requiredIf to a mixed type
3026 $this->requiredIf = $requiredIf;
3027
3028
3029ERROR: MissingParamType - Civi/Api4/Service/Spec/FieldSpec.php:213:31 - Parameter $dataType has no provided type
3030 public function setDataType($dataType) {
3031
3032
3033ERROR: MixedArgument - Civi/Api4/Service/Spec/FieldSpec.php:214:26 - Argument 1 of array_key_exists cannot be mixed, expecting array-key
3034 if (array_key_exists($dataType, self::$typeAliases)) {
3035
3036
3037ERROR: MixedAssignment - Civi/Api4/Service/Spec/FieldSpec.php:215:7 - Cannot assign $dataType to a mixed type
3038 $dataType = self::$typeAliases[$dataType];
3039
3040
3041ERROR: MixedArgument - Civi/Api4/Service/Spec/FieldSpec.php:219:61 - Argument 2 of sprintf cannot be mixed, expecting string|int|float
3042 throw new \Exception(sprintf('Invalid data type "%s', $dataType));
3043
3044
3045ERROR: MixedAssignment - Civi/Api4/Service/Spec/FieldSpec.php:222:5 - Cannot assign $this->dataType to a mixed type
3046 $this->dataType = $dataType;
3047
3048
3049ERROR: MissingReturnType - Civi/Api4/Service/Spec/FieldSpec.php:237:19 - Method Civi\Api4\Service\Spec\FieldSpec::setSerialize does not have a return type, expecting void
3050 public function setSerialize($serialize) {
3051
3052
3053ERROR: PossiblyNullPropertyAssignmentValue - Civi/Api4/Service/Spec/FieldSpec.php:238:24 - $this->serialize with non-nullable declared type 'int' cannot be assigned nullable type 'int|null'
3054 $this->serialize = $serialize;
3055
3056
3057ERROR: UndefinedClass - Civi/Api4/Service/Spec/FieldSpec.php:250:24 - Class or interface CRM_Utils_Type does not exist
3058 return array_merge(\CRM_Utils_Type::dataTypes(), $extraTypes);
3059
3060
3061ERROR: MixedArgument - Civi/Api4/Service/Spec/FieldSpec.php:250:24 - Argument 1 of array_merge cannot be mixed, expecting array<array-key, mixed>
3062 return array_merge(\CRM_Utils_Type::dataTypes(), $extraTypes);
3063
3064
3065ERROR: MixedInferredReturnType - Civi/Api4/Service/Spec/FieldSpec.php:254:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Service\Spec\FieldSpec::getOptions
3066 /**
3067 * @return array
3068 */
3069 public function getOptions() {
3070 if (!isset($this->options) || $this->options === TRUE) {
3071 $fieldName = $this->getName();
3072
3073 if ($this instanceof CustomFieldSpec) {
3074
3075
3076ERROR: UndefinedClass - Civi/Api4/Service/Spec/FieldSpec.php:266:18 - Class or interface CRM_Core_DAO does not exist
3077 $options = $dao::buildOptions($fieldName);
3078
3079
3080ERROR: InvalidStringClass - Civi/Api4/Service/Spec/FieldSpec.php:266:18 - String cannot be used as a class
3081 $options = $dao::buildOptions($fieldName);
3082
3083
3084ERROR: MixedAssignment - Civi/Api4/Service/Spec/FieldSpec.php:311:48 - Cannot assign $val to a mixed type
3085 foreach (get_object_vars($this) as $key => $val) {
3086
3087
3088ERROR: MixedAssignment - Civi/Api4/Service/Spec/FieldSpec.php:314:9 - Cannot assign to a mixed type
3089 $ret[$key] = $val;
3090
3091
3092ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ActionScheduleCreationSpecProvider.php:13:37 - Cannot call method setRequired on possibly null value
3093 $spec->getFieldByName('title')->setRequired(TRUE);
3094
3095
3096ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ActionScheduleCreationSpecProvider.php:14:42 - Cannot call method setRequired on possibly null value
3097 $spec->getFieldByName('mapping_id')->setRequired(TRUE);
3098
3099
3100ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ActionScheduleCreationSpecProvider.php:15:44 - Cannot call method setRequired on possibly null value
3101 $spec->getFieldByName('entity_value')->setRequired(TRUE);
3102
3103
3104ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ActionScheduleCreationSpecProvider.php:16:49 - Cannot call method setRequiredIf on possibly null value
3105 $spec->getFieldByName('start_action_date')->setRequiredIf('empty($values.absolute_date)');
3106
3107
3108ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ActionScheduleCreationSpecProvider.php:17:45 - Cannot call method setRequiredIf on possibly null value
3109 $spec->getFieldByName('absolute_date')->setRequiredIf('empty($values.start_action_date)');
3110
3111
3112ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/AddressCreationSpecProvider.php:15:42 - Cannot call method setRequired on possibly null value
3113 $spec->getFieldByName('contact_id')->setRequired(TRUE);
3114
3115
3116ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/AddressCreationSpecProvider.php:16:48 - Cannot call method setRequired on possibly null value
3117 $spec->getFieldByName('location_type_id')->setRequired(TRUE);
3118
3119
3120ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ContactCreationSpecProvider.php:14:9 - Cannot call method setRequired on possibly null value
3121 ->setRequired(TRUE)
3122
3123
3124ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ContactCreationSpecProvider.php:17:42 - Cannot call method setRequired on possibly null value
3125 $spec->getFieldByName('is_opt_out')->setRequired(FALSE);
3126
3127
3128ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ContactCreationSpecProvider.php:18:42 - Cannot call method setRequired on possibly null value
3129 $spec->getFieldByName('is_deleted')->setRequired(FALSE);
3130
3131
3132ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ContactTypeCreationSpecProvider.php:13:37 - Cannot call method setRequired on possibly null value
3133 $spec->getFieldByName('label')->setRequired(TRUE);
3134
3135
3136ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ContactTypeCreationSpecProvider.php:14:36 - Cannot call method setRequired on possibly null value
3137 $spec->getFieldByName('name')->setRequired(TRUE);
3138
3139
3140ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ContactTypeCreationSpecProvider.php:15:41 - Cannot call method setRequired on possibly null value
3141 $spec->getFieldByName('parent_id')->setRequired(TRUE);
3142
3143
3144ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ContributionCreationSpecProvider.php:12:49 - Cannot call method setRequired on possibly null value
3145 $spec->getFieldByName('financial_type_id')->setRequired(TRUE);
3146
3147
3148ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/ContributionCreationSpecProvider.php:13:44 - Cannot call method setDefaultValue on possibly null value
3149 $spec->getFieldByName('receive_date')->setDefaultValue('now');
3150
3151
3152ERROR: InvalidReturnType - Civi/Api4/Service/Spec/Provider/CustomGroupCreationSpecProvider.php:11:19 - The declared return type 'void' for Civi\Api4\Service\Spec\Provider\CustomGroupCreationSpecProvider::modifySpec is incorrect, got 'Civi\Api4\Service\Spec\FieldSpec'
3153 public function modifySpec(RequestSpec $spec) {
3154
3155
3156ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/CustomGroupCreationSpecProvider.php:12:46 - Cannot call method setRequired on possibly null value
3157 return $spec->getFieldByName('extends')->setRequired(TRUE);
3158
3159
3160ERROR: UndefinedFunction - Civi/Api4/Service/Spec/Provider/CustomValueSpecProvider.php:17:26 - Function Civi\Api4\Service\Spec\Provider\ts does not exist
3161 $idField->setTitle(ts('Custom Value ID'));
3162
3163
3164ERROR: InvalidReturnType - Civi/Api4/Service/Spec/Provider/CustomValueSpecProvider.php:30:19 - The declared return type 'bool' for Civi\Api4\Service\Spec\Provider\CustomValueSpecProvider::applies is incorrect, got 'string|false'
3165 public function applies($entity, $action) {
3166
3167
3168ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/EmailCreationSpecProvider.php:12:42 - Cannot call method setRequired on possibly null value
3169 $spec->getFieldByName('contact_id')->setRequired(TRUE);
3170
3171
3172ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/EmailCreationSpecProvider.php:13:37 - Cannot call method setRequired on possibly null value
3173 $spec->getFieldByName('email')->setRequired(TRUE);
3174
3175
3176ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/EmailCreationSpecProvider.php:14:39 - Cannot call method setRequired on possibly null value
3177 $spec->getFieldByName('on_hold')->setRequired(FALSE);
3178
3179
3180ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/EmailCreationSpecProvider.php:15:43 - Cannot call method setRequired on possibly null value
3181 $spec->getFieldByName('is_bulkmail')->setRequired(FALSE);
3182
3183
3184ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/EntityTagCreationSpecProvider.php:14:44 - Cannot call method setRequired on possibly null value
3185 $spec->getFieldByName('entity_table')->setRequired(TRUE);
3186
3187
3188ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/EventCreationSpecProvider.php:12:43 - Cannot call method setRequired on possibly null value
3189 $spec->getFieldByName('is_template')->setRequired(FALSE);
3190
3191
3192ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/GroupCreationSpecProvider.php:12:37 - Cannot call method setRequired on possibly null value
3193 $spec->getFieldByName('title')->setRequired(TRUE);
3194
3195
3196ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/NavigationCreationSpecProvider.php:12:41 - Cannot call method setRequired on possibly null value
3197 $spec->getFieldByName('domain_id')->setRequired(FALSE);
3198
3199
3200ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/NoteCreationSpecProvider.php:14:36 - Cannot call method setRequired on possibly null value
3201 $spec->getFieldByName('note')->setRequired(TRUE);
3202
3203
3204ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/NoteCreationSpecProvider.php:15:44 - Cannot call method setDefaultValue on possibly null value
3205 $spec->getFieldByName('entity_table')->setDefaultValue('civicrm_contact');
3206
3207
3208ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/OptionValueCreationSpecProvider.php:12:38 - Cannot call method setRequired on possibly null value
3209 $spec->getFieldByName('weight')->setRequired(FALSE);
3210
3211
3212ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/OptionValueCreationSpecProvider.php:13:37 - Cannot call method setRequired on possibly null value
3213 $spec->getFieldByName('value')->setRequired(FALSE);
3214
3215
3216ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/PhoneCreationSpecProvider.php:12:42 - Cannot call method setRequired on possibly null value
3217 $spec->getFieldByName('contact_id')->setRequired(TRUE);
3218
3219
3220ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/PhoneCreationSpecProvider.php:13:37 - Cannot call method setRequired on possibly null value
3221 $spec->getFieldByName('phone')->setRequired(TRUE);
3222
3223
3224ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/TagCreationSpecProvider.php:14:40 - Cannot call method setDefaultValue on possibly null value
3225 $spec->getFieldByName('used_for')->setDefaultValue('civicrm_contact');
3226
3227
3228ERROR: PossiblyNullReference - Civi/Api4/Service/Spec/Provider/UFFieldCreationSpecProvider.php:12:37 - Cannot call method setRequired on possibly null value
3229 $spec->getFieldByName('label')->setRequired(FALSE);
3230
3231
3232ERROR: MissingReturnType - Civi/Api4/Service/Spec/RequestSpec.php:31:19 - Method Civi\Api4\Service\Spec\RequestSpec::addFieldSpec does not have a return type, expecting void
3233 public function addFieldSpec(FieldSpec $field) {
3234
3235
3236ERROR: MissingParamType - Civi/Api4/Service/Spec/RequestSpec.php:40:34 - Parameter $name has no provided type
3237 public function getFieldByName($name) {
3238
3239
3240ERROR: MixedInferredReturnType - Civi/Api4/Service/Spec/SpecFormatter.php:33:14 - Could not verify return type 'Civi\Api4\Service\Spec\FieldSpec' for Civi\Api4\Service\Spec\SpecFormatter::arrayToField
3241 /**
3242 * @param array $data
3243 * @param string $entity
3244 *
3245 * @return FieldSpec
3246 */
3247 public static function arrayToField(array $data, $entity) {
3248 $dataTypeName = self::getDataType($data);
3249
3250 if (!empty($data['custom_group_id'])) {
3251
3252
3253ERROR: MixedArgument - Civi/Api4/Service/Spec/SpecFormatter.php:39:36 - Argument 1 of Civi\Api4\Service\Spec\CustomFieldSpec::__construct cannot be mixed, expecting string
3254 $field = new CustomFieldSpec($data['name'], $entity, $dataTypeName);
3255
3256
3257ERROR: MixedOperand - Civi/Api4/Service/Spec/SpecFormatter.php:41:25 - Left operand cannot be mixed
3258 $field->setName($data['custom_group']['name'] . '.' . $data['name']);
3259
3260
3261ERROR: MixedArrayAccess - Civi/Api4/Service/Spec/SpecFormatter.php:41:25 - Cannot access array value on mixed variable $data['custom_group']
3262 $field->setName($data['custom_group']['name'] . '.' . $data['name']);
3263
3264
3265ERROR: MixedOperand - Civi/Api4/Service/Spec/SpecFormatter.php:41:63 - Right operand cannot be mixed
3266 $field->setName($data['custom_group']['name'] . '.' . $data['name']);
3267
3268
3269ERROR: MixedArrayAccess - Civi/Api4/Service/Spec/SpecFormatter.php:44:36 - Cannot access array value on mixed variable $data['custom_group']
3270 $field->setCustomTableName($data['custom_group']['table_name']);
3271
3272
3273ERROR: MixedArgument - Civi/Api4/Service/Spec/SpecFormatter.php:44:36 - Argument 1 of Civi\Api4\Service\Spec\CustomFieldSpec::setcustomtablename cannot be mixed, expecting string
3274 $field->setCustomTableName($data['custom_group']['table_name']);
3275
3276
3277ERROR: MixedArgument - Civi/Api4/Service/Spec/SpecFormatter.php:45:42 - Argument 1 of Civi\Api4\Service\Spec\CustomFieldSpec::setcustomfieldcolumnname cannot be mixed, expecting string
3278 $field->setCustomFieldColumnName($data['column_name']);
3279
3280
3281ERROR: UndefinedClass - Civi/Api4/Service/Spec/SpecFormatter.php:47:32 - Class or interface CRM_Utils_Array does not exist
3282 $field->setCustomFieldId(ArrayHelper::value('id', $data));
3283
3284
3285ERROR: MixedArgument - Civi/Api4/Service/Spec/SpecFormatter.php:92:16 - Argument 1 of strpos cannot be mixed, expecting string
3286 if (strpos($field['html_type'], 'Select')) {
3287
3288
3289ERROR: MixedInferredReturnType - Civi/Api4/Service/Spec/SpecFormatter.php:104:14 - Could not verify return type 'string' for Civi\Api4\Service\Spec\SpecFormatter::getDataType
3290 /**
3291 * Get the data type from an array. Defaults to 'data_type' with fallback to
3292 * mapping for the integer value 'type'
3293 *
3294 * @param array $data
3295 *
3296 * @return string
3297 */
3298 private static function getDataType(array $data) {
3299 if (isset($data['data_type'])) {
3300 return !empty($data['time_format']) ? 'Timestamp' : $data['data_type'];
3301 }
3302
3303
3304
3305ERROR: MixedReturnStatement - Civi/Api4/Service/Spec/SpecFormatter.php:108:14 - Could not infer a return type
3306 return !empty($data['time_format']) ? 'Timestamp' : $data['data_type'];
3307
3308
3309ERROR: UndefinedClass - Civi/Api4/Service/Spec/SpecFormatter.php:111:20 - Class or interface CRM_Utils_Array does not exist
3310 $dataTypeInt = ArrayHelper::value('type', $data);
3311
3312
3313ERROR: UndefinedDocblockClass - Civi/Api4/Service/Spec/SpecGatherer.php:19:11 - Docblock-defined class or interface CRM_Core_DAO does not exist
3314 /**
3315 * A cache of DAOs based on entity
3316 *
3317 * @var \CRM_Core_DAO[]
3318 */
3319 protected $DAONames;
3320
3321
3322ERROR: MissingConstructor - Civi/Api4/Service/Spec/SpecGatherer.php:21:13 - Civi\Api4\Service\Spec\SpecGatherer has an uninitialized variable $this->DAONames, but no constructor
3323 protected $DAONames;
3324
3325
3326ERROR: MissingParamType - Civi/Api4/Service/Spec/SpecGatherer.php:34:45 - Parameter $includeCustom has no provided type
3327 public function getSpec($entity, $action, $includeCustom) {
3328
3329
3330ERROR: MixedArgument - Civi/Api4/Service/Spec/SpecGatherer.php:40:55 - Argument 2 of array_key_exists cannot be mixed, expecting array<TKey, mixed>
3331 if ($includeCustom && array_key_exists($entity, \CRM_Core_SelectValues::customGroupExtends())) {
3332
3333
3334ERROR: UndefinedClass - Civi/Api4/Service/Spec/SpecGatherer.php:40:55 - Class or interface CRM_Core_SelectValues does not exist
3335 if ($includeCustom && array_key_exists($entity, \CRM_Core_SelectValues::customGroupExtends())) {
3336
3337
3338ERROR: MissingReturnType - Civi/Api4/Service/Spec/SpecGatherer.php:61:19 - Method Civi\Api4\Service\Spec\SpecGatherer::addSpecProvider does not have a return type, expecting void
3339 public function addSpecProvider(SpecProviderInterface $provider) {
3340
3341
3342ERROR: MissingReturnType - Civi/Api4/Service/Spec/SpecGatherer.php:69:20 - Method Civi\Api4\Service\Spec\SpecGatherer::addDAOFields does not have a return type, expecting void
3343 private function addDAOFields($entity, $action, RequestSpec $specification) {
3344
3345
3346ERROR: MissingParamType - Civi/Api4/Service/Spec/SpecGatherer.php:69:42 - Parameter $action has no provided type
3347 private function addDAOFields($entity, $action, RequestSpec $specification) {
3348
3349
3350ERROR: MixedAssignment - Civi/Api4/Service/Spec/SpecGatherer.php:72:28 - Cannot assign $DAOField to a mixed type
3351 foreach ($DAOFields as $DAOField) {
3352
3353
3354ERROR: MixedArrayAccess - Civi/Api4/Service/Spec/SpecGatherer.php:73:11 - Cannot access array value on mixed variable $DAOField
3355 if ($DAOField['name'] == 'id' && $action == 'create') {
3356
3357
3358ERROR: MixedArgument - Civi/Api4/Service/Spec/SpecGatherer.php:82:44 - Argument 1 of Civi\Api4\Service\Spec\SpecFormatter::arraytofield cannot be mixed, expecting array<array-key, mixed>
3359 $field = SpecFormatter::arrayToField($DAOField, $entity);
3360
3361
3362ERROR: MissingReturnType - Civi/Api4/Service/Spec/SpecGatherer.php:91:20 - Method Civi\Api4\Service\Spec\SpecGatherer::addCustomFields does not have a return type, expecting void
3363 private function addCustomFields($entity, RequestSpec $specification) {
3364
3365
3366ERROR: MixedAssignment - Civi/Api4/Service/Spec/SpecGatherer.php:99:31 - Cannot assign $fieldArray to a mixed type
3367 foreach ($customFields as $fieldArray) {
3368
3369
3370ERROR: MixedArgument - Civi/Api4/Service/Spec/SpecGatherer.php:100:44 - Argument 1 of Civi\Api4\Service\Spec\SpecFormatter::arraytofield cannot be mixed, expecting array<array-key, mixed>
3371 $field = SpecFormatter::arrayToField($fieldArray, $entity);
3372
3373
3374ERROR: MissingReturnType - Civi/Api4/Service/Spec/SpecGatherer.php:109:20 - Method Civi\Api4\Service\Spec\SpecGatherer::getCustomGroupFields does not have a return type, expecting void
3375 private function getCustomGroupFields($customGroup, RequestSpec $specification) {
3376
3377
3378ERROR: MixedAssignment - Civi/Api4/Service/Spec/SpecGatherer.php:115:31 - Cannot assign $fieldArray to a mixed type
3379 foreach ($customFields as $fieldArray) {
3380
3381
3382ERROR: MixedArgument - Civi/Api4/Service/Spec/SpecGatherer.php:116:44 - Argument 1 of Civi\Api4\Service\Spec\SpecFormatter::arraytofield cannot be mixed, expecting array<array-key, mixed>
3383 $field = SpecFormatter::arrayToField($fieldArray, 'Custom_' . $customGroup);
3384
3385
3386ERROR: MixedInferredReturnType - Civi/Api4/Service/Spec/SpecGatherer.php:124:14 - Could not verify return type 'array<array-key, mixed>' for Civi\Api4\Service\Spec\SpecGatherer::getDAOFields
3387 /**
3388 * @param string $entityName
3389 *
3390 * @return array
3391 */
3392 private function getDAOFields($entityName) {
3393 $dao = CoreUtil::getDAOFromApiName($entityName);
3394
3395 return $dao::fields();
3396 }
3397
3398
3399ERROR: UndefinedClass - Civi/Api4/Service/Spec/SpecGatherer.php:129:12 - Class or interface CRM_Core_DAO does not exist
3400 return $dao::fields();
3401
3402
3403ERROR: InvalidStringClass - Civi/Api4/Service/Spec/SpecGatherer.php:129:12 - String cannot be used as a class
3404 return $dao::fields();
3405
3406
3407ERROR: MissingReturnType - Civi/Api4/Setting.php:14:26 - Method Civi\Api4\Setting::get does not have a return type, expecting Civi\Api4\Action\Setting\Get
3408 public static function get() {
3409
3410
3411ERROR: MissingReturnType - Civi/Api4/Setting.php:18:26 - Method Civi\Api4\Setting::set does not have a return type, expecting Civi\Api4\Action\Setting\Set
3412 public static function set() {
3413
3414
3415ERROR: MissingReturnType - Civi/Api4/Setting.php:22:26 - Method Civi\Api4\Setting::revert does not have a return type, expecting Civi\Api4\Action\Setting\Revert
3416 public static function revert() {
3417
3418
3419ERROR: MissingReturnType - Civi/Api4/Setting.php:26:26 - Method Civi\Api4\Setting::getFields does not have a return type, expecting Civi\Api4\Action\Setting\GetFields
3420 public static function getFields() {
3421
3422
3423ERROR: MissingReturnType - Civi/Api4/System.php:13:26 - Method Civi\Api4\System::flush does not have a return type, expecting Civi\Api4\Action\System\Flush
3424 public static function flush() {
3425
3426
3427ERROR: MissingReturnType - Civi/Api4/System.php:17:26 - Method Civi\Api4\System::check does not have a return type, expecting Civi\Api4\Action\System\Check
3428 public static function check() {
3429
3430
3431ERROR: MissingReturnType - Civi/Api4/System.php:21:26 - Method Civi\Api4\System::getFields does not have a return type, expecting Civi\Api4\Generic\BasicGetFieldsAction
3432 public static function getFields() {
3433
3434
3435ERROR: MixedInferredReturnType - Civi/Api4/Utils/ActionUtil.php:10:14 - Could not verify return type 'Civi\Api4\Generic\AbstractAction' for Civi\Api4\Utils\ActionUtil::getAction
3436 /**
3437 * @param $entityName
3438 * @param $actionName
3439 * @return \Civi\Api4\Generic\AbstractAction
3440 * @throws \Civi\API\Exception\NotImplementedException
3441 */
3442 public static function getAction($entityName, $actionName) {
3443 // For custom pseudo-entities
3444
3445
3446ERROR: MissingParamType - Civi/Api4/Utils/ActionUtil.php:13:36 - Parameter $entityName has no provided type
3447 public static function getAction($entityName, $actionName) {
3448
3449
3450ERROR: MissingParamType - Civi/Api4/Utils/ActionUtil.php:13:49 - Parameter $actionName has no provided type
3451 public static function getAction($entityName, $actionName) {
3452
3453
3454ERROR: MixedArgument - Civi/Api4/Utils/ActionUtil.php:15:16 - Argument 1 of strpos cannot be mixed, expecting string
3455 if (strpos($entityName, 'Custom_') === 0) {
3456
3457
3458ERROR: MixedReturnStatement - Civi/Api4/Utils/ActionUtil.php:16:14 - Could not infer a return type
3459 return \Civi\Api4\CustomValue::$actionName(substr($entityName, 7));
3460
3461
3462ERROR: MixedArgument - Civi/Api4/Utils/ActionUtil.php:16:57 - Argument 1 of substr cannot be mixed, expecting string
3463 return \Civi\Api4\CustomValue::$actionName(substr($entityName, 7));
3464
3465
3466ERROR: UndefinedClass - Civi/Api4/Utils/ActionUtil.php:21:19 - Class or interface Civi\API\Exception\NotImplementedException does not exist
3467 throw new \Civi\API\Exception\NotImplementedException("API ($entityName, $actionName) does not exist (join the API team and implement it!)");
3468
3469
3470ERROR: MixedReturnStatement - Civi/Api4/Utils/ActionUtil.php:23:14 - Could not infer a return type
3471 return call_user_func($callable);
3472
3473
3474ERROR: MissingReturnType - Civi/Api4/Utils/ArrayInsertionUtil.php:20:26 - Method Civi\Api4\Utils\ArrayInsertionUtil::insert does not have a return type, expecting void
3475 public static function insert(&$array, $parts, $values) {
3476
3477
3478ERROR: MissingParamType - Civi/Api4/Utils/ArrayInsertionUtil.php:20:34 - Parameter $array has no provided type
3479 public static function insert(&$array, $parts, $values) {
3480
3481
3482ERROR: MixedAssignment - Civi/Api4/Utils/ArrayInsertionUtil.php:22:5 - Cannot assign $isMulti to a mixed type
3483 $isMulti = array_shift($parts);
3484
3485
3486ERROR: MixedAssignment - Civi/Api4/Utils/ArrayInsertionUtil.php:27:7 - Cannot assign $values to a mixed type
3487 $values = self::filterValues($array, $isMulti, $values);
3488
3489
3490ERROR: MixedAssignment - Civi/Api4/Utils/ArrayInsertionUtil.php:28:7 - Cannot assign to a mixed type
3491 $array[$key] = $values;
3492
3493
3494ERROR: MixedArrayAccess - Civi/Api4/Utils/ArrayInsertionUtil.php:32:18 - Cannot access array value on mixed variable $array
3495 foreach ($array[$key] as &$subArray) {
3496
3497
3498ERROR: MixedAssignment - Civi/Api4/Utils/ArrayInsertionUtil.php:32:35 - Cannot assign $subArray to a mixed type
3499 foreach ($array[$key] as &$subArray) {
3500
3501
3502ERROR: MissingParamType - Civi/Api4/Utils/ArrayInsertionUtil.php:49:40 - Parameter $parentArray has no provided type
3503 private static function filterValues($parentArray, $isMulti, $values) {
3504
3505
3506ERROR: MissingParamType - Civi/Api4/Utils/ArrayInsertionUtil.php:49:54 - Parameter $isMulti has no provided type
3507 private static function filterValues($parentArray, $isMulti, $values) {
3508
3509
3510ERROR: MissingParamType - Civi/Api4/Utils/ArrayInsertionUtil.php:49:64 - Parameter $values has no provided type
3511 private static function filterValues($parentArray, $isMulti, $values) {
3512
3513
3514ERROR: UndefinedClass - Civi/Api4/Utils/ArrayInsertionUtil.php:50:17 - Class or interface CRM_Utils_Array does not exist
3515 $parentID = UtilsArray::value('id', $parentArray);
3516
3517
3518ERROR: MissingFile - Civi/Api4/Utils/CoreUtil.php:7:1 - Cannot find file /home/coolife/git-repos/gsoc/api/api/v3/utils.php to include
3519require_once 'api/v3/utils.php';
3520
3521
3522ERROR: UndefinedDocblockClass - Civi/Api4/Utils/CoreUtil.php:16:14 - Docblock-defined class or interface CRM_Core_DAO does not exist
3523 /**
3524 * todo this class should not rely on api3 code
3525 *
3526 * @param $entityName
3527 *
3528 * @return \CRM_Core_DAO|string
3529 * The DAO name for use in static calls. Return doc block is hacked to allow
3530 * auto-completion of static methods
3531 */
3532 public static function getDAOFromApiName($entityName) {
3533
3534
3535ERROR: MixedInferredReturnType - Civi/Api4/Utils/CoreUtil.php:16:14 - Could not verify return type 'string|CRM_Core_DAO' for Civi\Api4\Utils\CoreUtil::getDAOFromApiName
3536 /**
3537 * todo this class should not rely on api3 code
3538 *
3539 * @param $entityName
3540 *
3541 * @return \CRM_Core_DAO|string
3542 * The DAO name for use in static calls. Return doc block is hacked to allow
3543 * auto-completion of static methods
3544 */
3545 public static function getDAOFromApiName($entityName) {
3546
3547
3548ERROR: MissingParamType - Civi/Api4/Utils/CoreUtil.php:20:44 - Parameter $entityName has no provided type
3549 public static function getDAOFromApiName($entityName) {
3550
3551
3552ERROR: MixedArgument - Civi/Api4/Utils/CoreUtil.php:21:49 - Argument 1 of strpos cannot be mixed, expecting string
3553 if ($entityName === 'CustomValue' || strpos($entityName, 'Custom_') === 0) {
3554
3555
3556ERROR: UndefinedFunction - Civi/Api4/Utils/CoreUtil.php:24:12 - Function _civicrm_api3_get_DAO does not exist
3557 return \_civicrm_api3_get_DAO($entityName);
3558
3559
3560ERROR: MixedInferredReturnType - Civi/Api4/Utils/CoreUtil.php:32:14 - Could not verify return type 'string' for Civi\Api4\Utils\CoreUtil::getCustomTableByName
3561 /**
3562 * Get table name of given Custom group
3563 *
3564 * @param string $customGroupName
3565 *
3566 * @return string
3567 */
3568 public static function getCustomTableByName($customGroupName) {
3569 return CustomGroup::get()
3570 ->addSelect('table_name')
3571 ->addWhere('name', '=', $customGroupName)
3572 ->execute()
3573
3574
3575ERROR: MixedReturnStatement - Civi/Api4/Utils/CoreUtil.php:35:12 - Could not infer a return type
3576 return CustomGroup::get()
3577 ->addSelect('table_name')
3578 ->addWhere('name', '=', $customGroupName)
3579 ->execute()
3580 ->first()['table_name'];
3581
3582
3583ERROR: PossiblyNullArrayAccess - Civi/Api4/Utils/CoreUtil.php:35:12 - Cannot access array value on possibly null variable of type array<array-key, mixed>|null
3584 return CustomGroup::get()
3585 ->addSelect('table_name')
3586 ->addWhere('name', '=', $customGroupName)
3587 ->execute()
3588 ->first()['table_name'];
3589
3590
3591ERROR: MissingFile - Civi/Api4/Utils/FormattingUtil.php:7:1 - Cannot find file /home/coolife/git-repos/gsoc/api/api/v3/utils.php to include
3592require_once 'api/v3/utils.php';
3593
3594
3595ERROR: MissingReturnType - Civi/Api4/Utils/FormattingUtil.php:19:26 - Method Civi\Api4\Utils\FormattingUtil::formatWriteParams does not have a return type, expecting void
3596 public static function formatWriteParams(&$params, $entity, $fields) {
3597
3598
3599ERROR: MissingParamType - Civi/Api4/Utils/FormattingUtil.php:19:45 - Parameter $params has no provided type
3600 public static function formatWriteParams(&$params, $entity, $fields) {
3601
3602
3603ERROR: MissingParamType - Civi/Api4/Utils/FormattingUtil.php:19:54 - Parameter $entity has no provided type
3604 public static function formatWriteParams(&$params, $entity, $fields) {
3605
3606
3607ERROR: MissingParamType - Civi/Api4/Utils/FormattingUtil.php:19:63 - Parameter $fields has no provided type
3608 public static function formatWriteParams(&$params, $entity, $fields) {
3609
3610
3611ERROR: MixedAssignment - Civi/Api4/Utils/FormattingUtil.php:20:34 - Cannot assign $field to a mixed type
3612 foreach ($fields as $name => $field) {
3613
3614
3615ERROR: MixedArrayOffset - Civi/Api4/Utils/FormattingUtil.php:21:18 - Cannot access value on variable $params using mixed offset
3616 if (!empty($params[$name])) {
3617
3618
3619ERROR: MixedAssignment - Civi/Api4/Utils/FormattingUtil.php:22:9 - Cannot assign $value to a mixed type
3620 $value =& $params[$name];
3621
3622
3623ERROR: MixedArrayAccess - Civi/Api4/Utils/FormattingUtil.php:22:19 - Cannot access array value on mixed variable $params
3624 $value =& $params[$name];
3625
3626
3627ERROR: MixedArrayOffset - Civi/Api4/Utils/FormattingUtil.php:22:19 - Cannot access value on variable $params using mixed offset
3628 $value =& $params[$name];
3629
3630
3631ERROR: MixedArgument - Civi/Api4/Utils/FormattingUtil.php:45:32 - Argument 1 of array_key_exists cannot be mixed, expecting array-key
3632 elseif (array_key_exists($name, $params) && $params[$name] === NULL) {
3633
3634
3635ERROR: MixedArgument - Civi/Api4/Utils/FormattingUtil.php:45:39 - Argument 2 of array_key_exists cannot be mixed, expecting array<array-key, mixed>
3636 elseif (array_key_exists($name, $params) && $params[$name] === NULL) {
3637
3638
3639ERROR: MissingReturnType - Civi/Api4/Utils/FormattingUtil.php:61:26 - Method Civi\Api4\Utils\FormattingUtil::formatValue does not have a return type, expecting void
3640 public static function formatValue(&$value, $fieldSpec, $entity) {
3641
3642
3643ERROR: MissingParamType - Civi/Api4/Utils/FormattingUtil.php:61:39 - Parameter $value has no provided type
3644 public static function formatValue(&$value, $fieldSpec, $entity) {
3645
3646
3647ERROR: MissingParamType - Civi/Api4/Utils/FormattingUtil.php:61:47 - Parameter $fieldSpec has no provided type
3648 public static function formatValue(&$value, $fieldSpec, $entity) {
3649
3650
3651ERROR: MissingParamType - Civi/Api4/Utils/FormattingUtil.php:61:59 - Parameter $entity has no provided type
3652 public static function formatValue(&$value, $fieldSpec, $entity) {
3653
3654
3655ERROR: MixedAssignment - Civi/Api4/Utils/FormattingUtil.php:63:27 - Cannot assign $val to a mixed type
3656 foreach ($value as &$val) {
3657
3658
3659ERROR: UndefinedClass - Civi/Api4/Utils/FormattingUtil.php:68:11 - Class or interface CRM_Utils_Array does not exist
3660 $fk = UtilsArray::value('fk_entity', $fieldSpec);
3661
3662
3663ERROR: MixedArgument - Civi/Api4/Utils/ReflectionUtils.php:42:33 - Argument 1 of Civi\Api4\Utils\ReflectionUtils::parsedocblock cannot be mixed, expecting string
3664 $docs = self::parseDocBlock($reflection->getDocComment());
3665
3666
3667ERROR: PossiblyUndefinedMethod - Civi/Api4/Utils/ReflectionUtils.php:42:46 - Method Reflector::getdoccomment does not exist
3668 $docs = self::parseDocBlock($reflection->getDocComment());
3669
3670
3671ERROR: MixedAssignment - Civi/Api4/Utils/ReflectionUtils.php:50:11 - Cannot assign $name to a mixed type
3672 $name = $reflection->getName();
3673
3674
3675ERROR: PossiblyUndefinedMethod - Civi/Api4/Utils/ReflectionUtils.php:50:32 - Method Reflector::getname does not exist
3676 $name = $reflection->getName();
3677
3678
3679ERROR: MixedAssignment - Civi/Api4/Utils/ReflectionUtils.php:51:11 - Cannot assign $reflectionClass to a mixed type
3680 $reflectionClass = $reflection->getDeclaringClass()->getParentClass();
3681
3682
3683ERROR: UndefinedMethod - Civi/Api4/Utils/ReflectionUtils.php:51:43 - Method ReflectionClass::getdeclaringclass does not exist
3684 $reflectionClass = $reflection->getDeclaringClass()->getParentClass();
3685
3686
3687ERROR: MixedMethodCall - Civi/Api4/Utils/ReflectionUtils.php:51:64 - Cannot determine the type of the object on the left hand side of this expression
3688 $reflectionClass = $reflection->getDeclaringClass()->getParentClass();
3689
3690
3691ERROR: MixedAssignment - Civi/Api4/Utils/ReflectionUtils.php:54:13 - Cannot assign $newReflection to a mixed type
3692 $newReflection = $reflectionClass->$getItem($name);
3693
3694
3695ERROR: MixedMethodCall - Civi/Api4/Utils/ReflectionUtils.php:54:48 - Cannot determine the type of the object on the left hand side of this expression
3696 $newReflection = $reflectionClass->$getItem($name);
3697
3698
3699ERROR: MixedAssignment - Civi/Api4/Utils/ReflectionUtils.php:58:11 - Cannot assign $newReflection to a mixed type
3700 $newReflection = $reflection->getParentClass();
3701
3702
3703ERROR: PossiblyUndefinedMethod - Civi/Api4/Utils/ReflectionUtils.php:58:41 - Method Reflector::getparentclass does not exist
3704 $newReflection = $reflection->getParentClass();
3705
3706
3707ERROR: MixedArgument - Civi/Api4/Utils/ReflectionUtils.php:64:45 - Argument 1 of Civi\Api4\Utils\ReflectionUtils::getcodedocs cannot be mixed, expecting Reflector|ReflectionClass
3708 $additionalDocs = self::getCodeDocs($newReflection, $type);
3709
3710
3711ERROR: MixedOperand - Civi/Api4/Utils/ReflectionUtils.php:66:11 - Left operand cannot be mixed
3712 $docs['comment'] .= "\n\n" . $additionalDocs['comment'];
3713
3714
3715ERROR: MixedOperand - Civi/Api4/Utils/ReflectionUtils.php:66:40 - Right operand cannot be mixed
3716 $docs['comment'] .= "\n\n" . $additionalDocs['comment'];
3717
3718
3719ERROR: PossiblyInvalidCast - Civi/Api4/Utils/ReflectionUtils.php:110:56 - non-empty-array<int, string> cannot be cast to string
3720 $info['comment'] = isset($info['comment']) ? "{$info['comment']}\n$line" : $line;
3721
3722
3723ERROR: PossiblyInvalidArgument - Civi/Api4/Utils/ReflectionUtils.php:114:31 - Argument 1 of trim expects string, possibly different type non-empty-array<int, string>|string|true provided
3724 $info['comment'] = trim($info['comment']);
3725
3726
3727ERROR: MixedAssignment - Civi/Api4/Utils/ReflectionUtils.php:132:35 - Cannot assign $same to a mixed type
3728 foreach ($traits as $trait => $same) {
3729
3730
3731ERROR: LoopInvalidation - Civi/Api4/Utils/ReflectionUtils.php:133:7 - Variable $traits has already been assigned in a for/foreach loop
3732 $traits = array_merge(class_uses($trait), $traits);
3733
3734
3735ERROR: MixedArgumentTypeCoercion - Civi/Api4/Utils/ReflectionUtils.php:133:40 - Argument 1 of class_uses expects object|string, parent type array-key provided
3736 $traits = array_merge(class_uses($trait), $traits);
3737
3738
3739ERROR: MixedInferredReturnType - api4.civix.php:23:14 - Could not verify return type 'string' for CRM_Api4_ExtensionUtil::ts
3740 /**
3741 * Translate a string using the extension's domain.
3742 *
3743 * If the extension doesn't have a specific translation
3744 * for the string, fallback to the default translations.
3745 *
3746 * @param string $text
3747 * Canonical message text (generally en_US).
3748 * @param array $params
3749 * @return string
3750 * Translated text.
3751 * @see ts
3752 */
3753 public static function ts($text, $params = array()) {
3754 if (!array_key_exists('domain', $params)) {
3755
3756
3757ERROR: UndefinedFunction - api4.civix.php:31:12 - Function ts does not exist
3758 return ts($text, $params);
3759
3760
3761ERROR: MixedInferredReturnType - api4.civix.php:40:14 - Could not verify return type 'string' for CRM_Api4_ExtensionUtil::url
3762 /**
3763 * Get the URL of a resource file (in this extension).
3764 *
3765 * @param string|NULL $file
3766 * Ex: NULL.
3767 * Ex: 'css/foo.css'.
3768 * @return string
3769 * Ex: 'http://example.org/sites/default/ext/org.example.foo'.
3770 * Ex: 'http://example.org/sites/default/ext/org.example.foo/css/foo.css'.
3771 */
3772 public static function url($file = NULL) {
3773
3774
3775ERROR: MixedArgument - api4.civix.php:46:20 - Argument 1 of rtrim cannot be mixed, expecting string
3776 return rtrim(CRM_Core_Resources::singleton()->getUrl(self::LONG_NAME), '/');
3777
3778
3779ERROR: UndefinedClass - api4.civix.php:46:20 - Class or interface CRM_Core_Resources does not exist
3780 return rtrim(CRM_Core_Resources::singleton()->getUrl(self::LONG_NAME), '/');
3781
3782
3783ERROR: MixedArgument - api4.civix.php:46:78 - Argument 2 of rtrim cannot be mixed, expecting string
3784 return rtrim(CRM_Core_Resources::singleton()->getUrl(self::LONG_NAME), '/');
3785
3786
3787ERROR: UndefinedClass - api4.civix.php:48:12 - Class or interface CRM_Core_Resources does not exist
3788 return CRM_Core_Resources::singleton()->getUrl(self::LONG_NAME, $file);
3789
3790
3791ERROR: MissingReturnType - api4.civix.php:87:10 - Method _api4_civix_civicrm_config does not have a return type, expecting void
3792function _api4_civix_civicrm_config(&$config = NULL) {
3793
3794
3795ERROR: MissingParamType - api4.civix.php:87:38 - Parameter $config has no provided type
3796function _api4_civix_civicrm_config(&$config = NULL) {
3797
3798
3799ERROR: UndefinedClass - api4.civix.php:94:16 - Class or interface CRM_Core_Smarty does not exist
3800 $template =& CRM_Core_Smarty::singleton();
3801
3802
3803ERROR: MissingReturnType - api4.civix.php:117:10 - Method _api4_civix_civicrm_xmlMenu does not have a return type, expecting void
3804function _api4_civix_civicrm_xmlMenu(&$files) {
3805
3806
3807ERROR: MissingParamType - api4.civix.php:117:39 - Parameter $files has no provided type
3808function _api4_civix_civicrm_xmlMenu(&$files) {
3809
3810
3811ERROR: MixedAssignment - api4.civix.php:118:61 - Cannot assign $file to a mixed type
3812 foreach (_api4_civix_glob(__DIR__ . '/xml/Menu/*.xml') as $file) {
3813
3814
3815ERROR: MixedAssignment - api4.civix.php:119:5 - Cannot assign to a mixed type
3816 $files[] = $file;
3817
3818
3819ERROR: MissingReturnType - api4.civix.php:128:10 - Method _api4_civix_civicrm_install does not have a return type, expecting void
3820function _api4_civix_civicrm_install() {
3821
3822
3823ERROR: MissingReturnType - api4.civix.php:140:10 - Method _api4_civix_civicrm_postInstall does not have a return type, expecting void
3824function _api4_civix_civicrm_postInstall() {
3825
3826
3827ERROR: MissingReturnType - api4.civix.php:154:10 - Method _api4_civix_civicrm_uninstall does not have a return type, expecting void
3828function _api4_civix_civicrm_uninstall() {
3829
3830
3831ERROR: MissingReturnType - api4.civix.php:166:10 - Method _api4_civix_civicrm_enable does not have a return type, expecting void
3832function _api4_civix_civicrm_enable() {
3833
3834
3835ERROR: InvalidReturnType - api4.civix.php:179:12 - No return statements were found for method _api4_civix_civicrm_disable but return type 'mixed' was expected
3836/**
3837 * (Delegated) Implements hook_civicrm_disable().
3838 *
3839 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable
3840 * @return mixed
3841 */
3842function _api4_civix_civicrm_disable() {
3843 _api4_civix_civicrm_config();
3844 if ($upgrader = _api4_civix_upgrader()) {
3845 if (is_callable(array($upgrader, 'onDisable'))) {
3846
3847
3848ERROR: UndefinedClass - api4.civix.php:201:43 - Class or interface CRM_Queue_Queue does not exist
3849function _api4_civix_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
3850
3851
3852ERROR: MixedInferredReturnType - api4.civix.php:208:12 - Could not verify return type 'CRM_Api4_Upgrader' for _api4_civix_upgrader
3853/**
3854 * @return CRM_Api4_Upgrader
3855 */
3856function _api4_civix_upgrader() {
3857 if (!file_exists(__DIR__ . '/CRM/Api4/Upgrader.php')) {
3858 return NULL;
3859 }
3860 else {
3861 return CRM_Api4_Upgrader_Base::instance();
3862 }
3863}
3864
3865
3866ERROR: NullableReturnStatement - api4.civix.php:212:12 - The declared return type 'CRM_Api4_Upgrader' for _api4_civix_upgrader is not nullable, but the function returns 'null'
3867 return NULL;
3868
3869
3870ERROR: MixedReturnStatement - api4.civix.php:215:12 - Could not infer a return type
3871 return CRM_Api4_Upgrader_Base::instance();
3872
3873
3874ERROR: InvalidDocblock - api4.civix.php:229:1 - Bracket must be preceded by “Closureâ€, “callable†or a valid @method name in docblock for _api4_civix_find_files
3875/**
3876 * Search directory tree for files which match a glob pattern
3877 *
3878 * Note: Dot-directories (like "..", ".git", or ".svn") will be ignored.
3879 * Note: In Civi 4.3+, delegate to CRM_Utils_File::findFiles()
3880 *
3881 * @param $dir string, base dir
3882 * @param $pattern string, glob pattern, eg "*.txt"
3883 * @return array(string)
3884 */
3885function _api4_civix_find_files($dir, $pattern) {
3886
3887
3888ERROR: MissingReturnType - api4.civix.php:229:10 - Method _api4_civix_find_files does not have a return type
3889function _api4_civix_find_files($dir, $pattern) {
3890
3891
3892ERROR: MissingParamType - api4.civix.php:229:33 - Parameter $dir has no provided type
3893function _api4_civix_find_files($dir, $pattern) {
3894
3895
3896ERROR: MissingParamType - api4.civix.php:229:39 - Parameter $pattern has no provided type
3897function _api4_civix_find_files($dir, $pattern) {
3898
3899
3900ERROR: UndefinedClass - api4.civix.php:231:12 - Class or interface CRM_Utils_File does not exist
3901 return CRM_Utils_File::findFiles($dir, $pattern);
3902
3903
3904ERROR: MixedAssignment - api4.civix.php:237:5 - Cannot assign $subdir to a mixed type
3905 $subdir = array_shift($todos);
3906
3907
3908ERROR: MixedAssignment - api4.civix.php:238:54 - Cannot assign $match to a mixed type
3909 foreach (_api4_civix_glob("$subdir/$pattern") as $match) {
3910
3911
3912ERROR: MixedArgument - api4.civix.php:239:19 - Argument 1 of is_dir cannot be mixed, expecting string
3913 if (!is_dir($match)) {
3914
3915
3916ERROR: MixedAssignment - api4.civix.php:240:9 - Cannot assign to a mixed type
3917 $result[] = $match;
3918
3919
3920ERROR: MixedArgument - api4.civix.php:243:23 - Argument 1 of opendir cannot be mixed, expecting string
3921 if ($dh = opendir($subdir)) {
3922
3923
3924ERROR: MixedOperand - api4.civix.php:245:17 - Left operand cannot be mixed
3925 $path = $subdir . DIRECTORY_SEPARATOR . $entry;
3926
3927
3928ERROR: MissingReturnType - api4.civix.php:264:10 - Method _api4_civix_civicrm_managed does not have a return type, expecting void
3929function _api4_civix_civicrm_managed(&$entities) {
3930
3931
3932ERROR: MissingParamType - api4.civix.php:264:39 - Parameter $entities has no provided type
3933function _api4_civix_civicrm_managed(&$entities) {
3934
3935
3936ERROR: MixedAssignment - api4.civix.php:265:3 - Cannot assign $mgdFiles to a mixed type
3937 $mgdFiles = _api4_civix_find_files(__DIR__, '*.mgd.php');
3938
3939
3940ERROR: MixedAssignment - api4.civix.php:266:25 - Cannot assign $file to a mixed type
3941 foreach ($mgdFiles as $file) {
3942
3943
3944ERROR: MixedAssignment - api4.civix.php:267:5 - Cannot assign $es to a mixed type
3945 $es = include $file;
3946
3947
3948ERROR: UnresolvableInclude - api4.civix.php:267:11 - Cannot resolve the given expression to a file path
3949 $es = include $file;
3950
3951
3952ERROR: MixedAssignment - api4.civix.php:268:21 - Cannot assign $e to a mixed type
3953 foreach ($es as $e) {
3954
3955
3956ERROR: MixedAssignment - api4.civix.php:272:7 - Cannot assign to a mixed type
3957 $entities[] = $e;
3958
3959
3960ERROR: MixedArrayAccess - api4.civix.php:274:9 - Cannot access array value on mixed variable $e
3961 $e['params']['version'] = '3';
3962
3963
3964ERROR: MissingReturnType - api4.civix.php:289:10 - Method _api4_civix_civicrm_caseTypes does not have a return type, expecting void
3965function _api4_civix_civicrm_caseTypes(&$caseTypes) {
3966
3967
3968ERROR: MissingParamType - api4.civix.php:289:41 - Parameter $caseTypes has no provided type
3969function _api4_civix_civicrm_caseTypes(&$caseTypes) {
3970
3971
3972ERROR: MixedAssignment - api4.civix.php:294:61 - Cannot assign $file to a mixed type
3973 foreach (_api4_civix_glob(__DIR__ . '/xml/case/*.xml') as $file) {
3974
3975
3976ERROR: MixedArgument - api4.civix.php:295:51 - Argument 1 of basename cannot be mixed, expecting string
3977 $name = preg_replace('/\.xml$/', '', basename($file));
3978
3979
3980ERROR: UndefinedClass - api4.civix.php:296:18 - Class or interface CRM_Case_XMLProcessor does not exist
3981 if ($name != CRM_Case_XMLProcessor::mungeCaseType($name)) {
3982
3983
3984ERROR: MixedArgument - api4.civix.php:297:85 - Argument 3 of sprintf cannot be mixed, expecting string|int|float
3985 $errorMessage = sprintf("Case-type file name is malformed (%s vs %s)", $name, CRM_Case_XMLProcessor::mungeCaseType($name));
3986
3987
3988ERROR: UndefinedClass - api4.civix.php:297:85 - Class or interface CRM_Case_XMLProcessor does not exist
3989 $errorMessage = sprintf("Case-type file name is malformed (%s vs %s)", $name, CRM_Case_XMLProcessor::mungeCaseType($name));
3990
3991
3992ERROR: UndefinedClass - api4.civix.php:298:7 - Class or interface CRM_Core_Error does not exist
3993 CRM_Core_Error::fatal($errorMessage);
3994
3995
3996ERROR: MissingReturnType - api4.civix.php:318:10 - Method _api4_civix_civicrm_angularModules does not have a return type, expecting void
3997function _api4_civix_civicrm_angularModules(&$angularModules) {
3998
3999
4000ERROR: MissingParamType - api4.civix.php:318:46 - Parameter $angularModules has no provided type
4001function _api4_civix_civicrm_angularModules(&$angularModules) {
4002
4003
4004ERROR: MixedAssignment - api4.civix.php:323:3 - Cannot assign $files to a mixed type
4005 $files = _api4_civix_glob(__DIR__ . '/ang/*.ang.php');
4006
4007
4008ERROR: MixedAssignment - api4.civix.php:324:22 - Cannot assign $file to a mixed type
4009 foreach ($files as $file) {
4010
4011
4012ERROR: MixedAssignment - api4.civix.php:326:5 - Cannot assign $module to a mixed type
4013 $module = include $file;
4014
4015
4016ERROR: UnresolvableInclude - api4.civix.php:326:15 - Cannot resolve the given expression to a file path
4017 $module = include $file;
4018
4019
4020ERROR: MixedAssignment - api4.civix.php:330:5 - Cannot assign to a mixed type
4021 $angularModules[$name] = $module;
4022
4023
4024ERROR: InvalidDocblock - api4.civix.php:346:1 - Cannot parse comma without a parent node in docblock for _api4_civix_glob
4025/**
4026 * Glob wrapper which is guaranteed to return an array.
4027 *
4028 * The documentation for glob() says, "On some systems it is impossible to
4029 * distinguish between empty match and an error." Anecdotally, the return
4030 * result for an empty match is sometimes array() and sometimes FALSE.
4031 * This wrapper provides consistency.
4032 *
4033 * @link http://php.net/glob
4034 * @param string $pattern
4035 * @return array, possibly empty
4036 */
4037function _api4_civix_glob($pattern) {
4038
4039
4040ERROR: MissingReturnType - api4.civix.php:346:10 - Method _api4_civix_glob does not have a return type, expecting array<int, string>
4041function _api4_civix_glob($pattern) {
4042
4043
4044ERROR: MissingReturnType - api4.civix.php:360:10 - Method _api4_civix_insert_navigation_menu does not have a return type
4045function _api4_civix_insert_navigation_menu(&$menu, $path, $item) {
4046
4047
4048ERROR: MixedArgument - api4.civix.php:364:35 - Argument 1 of array_merge cannot be mixed, expecting array<array-key, mixed>
4049 'attributes' => array_merge(array(
4050 'label' => CRM_Utils_Array::value('name', $item),
4051 'active' => 1,
4052 ), $item),
4053
4054
4055ERROR: UndefinedClass - api4.civix.php:365:25 - Class or interface CRM_Utils_Array does not exist
4056 'label' => CRM_Utils_Array::value('name', $item),
4057
4058
4059ERROR: MixedAssignment - api4.civix.php:376:32 - Cannot assign $entry to a mixed type
4060 foreach ($menu as $key => &$entry) {
4061
4062
4063ERROR: MixedArrayAccess - api4.civix.php:377:11 - Cannot access array value on mixed variable $entry
4064 if ($entry['attributes']['name'] == $first) {
4065
4066
4067ERROR: MixedAssignment - api4.civix.php:381:9 - Cannot assign $found to a mixed type
4068 $found = _api4_civix_insert_navigation_menu($entry['child'], implode('/', $path), $item, $key);
4069
4070
4071ERROR: TooManyArguments - api4.civix.php:381:18 - Too many arguments for method _api4_civix_insert_navigation_menu - expecting 3 but saw 4
4072 $found = _api4_civix_insert_navigation_menu($entry['child'], implode('/', $path), $item, $key);
4073
4074
4075ERROR: MissingReturnType - api4.civix.php:391:10 - Method _api4_civix_navigationMenu does not have a return type, expecting void
4076function _api4_civix_navigationMenu(&$nodes) {
4077
4078
4079ERROR: MissingParamType - api4.civix.php:391:38 - Parameter $nodes has no provided type
4080function _api4_civix_navigationMenu(&$nodes) {
4081
4082
4083ERROR: MissingReturnType - api4.civix.php:401:10 - Method _api4_civix_fixNavigationMenu does not have a return type, expecting void
4084function _api4_civix_fixNavigationMenu(&$nodes) {
4085
4086
4087ERROR: MissingParamType - api4.civix.php:401:41 - Parameter $nodes has no provided type
4088function _api4_civix_fixNavigationMenu(&$nodes) {
4089
4090
4091ERROR: MixedArgument - api4.civix.php:403:24 - Argument 1 of array_walk_recursive cannot be mixed, expecting array<array-key, mixed>
4092 array_walk_recursive($nodes, function($item, $key) use (&$maxNavID) {
4093
4094
4095ERROR: MissingClosureParamType - api4.civix.php:403:41 - Parameter $item has no provided type
4096 array_walk_recursive($nodes, function($item, $key) use (&$maxNavID) {
4097
4098
4099ERROR: MissingClosureParamType - api4.civix.php:403:48 - Parameter $key has no provided type
4100 array_walk_recursive($nodes, function($item, $key) use (&$maxNavID) {
4101
4102
4103ERROR: MixedAssignment - api4.civix.php:405:7 - Cannot assign $maxNavID to a mixed type
4104 $maxNavID = max($maxNavID, $item);
4105
4106
4107ERROR: MissingReturnType - api4.civix.php:411:10 - Method _api4_civix_fixNavigationMenuItems does not have a return type, expecting void
4108function _api4_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) {
4109
4110
4111ERROR: MissingParamType - api4.civix.php:411:46 - Parameter $nodes has no provided type
4112function _api4_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) {
4113
4114
4115ERROR: MissingParamType - api4.civix.php:411:55 - Parameter $maxNavID has no provided type
4116function _api4_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) {
4117
4118
4119ERROR: MissingParamType - api4.civix.php:411:66 - Parameter $parentID has no provided type
4120function _api4_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) {
4121
4122
4123ERROR: MixedArgument - api4.civix.php:412:26 - Argument 1 of array_keys cannot be mixed, expecting array<array-key, mixed>
4124 $origKeys = array_keys($nodes);
4125
4126
4127ERROR: MixedAssignment - api4.civix.php:415:7 - Cannot assign to a mixed type
4128 $nodes[$origKey]['attributes']['parentID'] = $parentID;
4129
4130
4131ERROR: MixedArrayAccess - api4.civix.php:415:7 - Cannot access array value on mixed variable $nodes
4132 $nodes[$origKey]['attributes']['parentID'] = $parentID;
4133
4134
4135ERROR: MixedAssignment - api4.civix.php:419:7 - Cannot assign $newKey to a mixed type
4136 $newKey = ++$maxNavID;
4137
4138
4139ERROR: MixedOperand - api4.civix.php:419:19 - Left operand cannot be mixed
4140 $newKey = ++$maxNavID;
4141
4142
4143ERROR: MixedAssignment - api4.civix.php:420:7 - Cannot assign to a mixed type
4144 $nodes[$origKey]['attributes']['navID'] = $newKey;
4145
4146
4147ERROR: MixedArrayAccess - api4.civix.php:420:7 - Cannot access array value on mixed variable $nodes
4148 $nodes[$origKey]['attributes']['navID'] = $newKey;
4149
4150
4151ERROR: MixedAssignment - api4.civix.php:421:7 - Cannot assign to a mixed type
4152 $nodes[$newKey] = $nodes[$origKey];
4153
4154
4155ERROR: MixedAssignment - api4.civix.php:423:7 - Cannot assign $origKey to a mixed type
4156 $origKey = $newKey;
4157
4158
4159ERROR: MixedArrayOffset - api4.civix.php:425:15 - Cannot access value on variable $nodes using mixed offset
4160 if (isset($nodes[$origKey]['child']) && is_array($nodes[$origKey]['child'])) {
4161
4162
4163ERROR: MixedArrayAccess - api4.civix.php:426:80 - Cannot access array value on mixed variable $nodes[$origKey]
4164 _api4_civix_fixNavigationMenuItems($nodes[$origKey]['child'], $maxNavID, $nodes[$origKey]['attributes']['navID']);
4165
4166
4167ERROR: MissingReturnType - api4.civix.php:436:10 - Method _api4_civix_civicrm_alterSettingsFolders does not have a return type, expecting void
4168function _api4_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
4169
4170
4171ERROR: MissingParamType - api4.civix.php:436:52 - Parameter $metaDataFolders has no provided type
4172function _api4_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
4173
4174
4175ERROR: MixedArgument - api4.civix.php:444:55 - Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed>
4176 if (is_dir($settingsDir) && !in_array($settingsDir, $metaDataFolders)) {
4177
4178
4179ERROR: MissingReturnType - api4.civix.php:457:10 - Method _api4_civix_civicrm_entityTypes does not have a return type, expecting void
4180function _api4_civix_civicrm_entityTypes(&$entityTypes) {
4181
4182
4183ERROR: MissingParamType - api4.civix.php:457:43 - Parameter $entityTypes has no provided type
4184function _api4_civix_civicrm_entityTypes(&$entityTypes) {
4185
4186
4187ERROR: MixedArgument - api4.civix.php:458:30 - Argument 1 of array_merge cannot be mixed, expecting array<array-key, mixed>
4188 $entityTypes = array_merge($entityTypes, array (
4189
4190
4191ERROR: MissingFile - api4.php:4:1 - Cannot find file /home/coolife/git-repos/gsoc/api/api/Exception.php to include
4192require_once 'api/Exception.php';
4193
4194
4195ERROR: MixedInferredReturnType - api4.php:21:12 - Could not verify return type 'Civi\Api4\Generic\Result' for civicrm_api4
4196/**
4197 * Procedural wrapper for the OO api version 4.
4198 *
4199 * @param string $entity
4200 * @param string $action
4201 * @param array $params
4202 * @param string|int $index
4203 * If $index is a string, the results array will be indexed by that key.
4204 * If $index is an integer, only the result at that index will be returned.
4205 *
4206 * @return \Civi\Api4\Generic\Result
4207 * @throws \API_Exception
4208 * @throws \Civi\API\Exception\NotImplementedException
4209 */
4210function civicrm_api4($entity, $action, $params = [], $index = NULL) {
4211
4212
4213ERROR: MixedAssignment - api4.php:27:32 - Cannot assign $param to a mixed type
4214 foreach ($params as $name => $param) {
4215
4216
4217ERROR: MixedArgumentTypeCoercion - api4.php:28:31 - Argument 1 of ucfirst expects string, parent type array-key provided
4218 $setter = 'set' . ucfirst($name);
4219
4220
4221ERROR: UndefinedClass - api4.php:34:39 - Class or interface CRM_Utils_Rule does not exist
4222 if ($index && is_string($index) && !CRM_Utils_Rule::integer($index)) {
4223
4224
4225ERROR: UndefinedDocblockClass - api4.php:54:11 - Docblock-defined class or interface Symfony\Component\DependencyInjection\ContainerBuilder does not exist
4226/**
4227 * @param ContainerBuilder $container
4228 */
4229function api4_civicrm_container($container) {
4230
4231
4232ERROR: MissingReturnType - api4.php:56:10 - Method api4_civicrm_container does not have a return type, expecting void
4233function api4_civicrm_container($container) {
4234
4235
4236ERROR: UndefinedDocblockClass - api4.php:99:11 - Docblock-defined class or interface Symfony\Component\DependencyInjection\ContainerBuilder does not exist
4237/**
4238 * Load all services in a given directory
4239 *
4240 * @param string $namespace
4241 * @param ContainerBuilder $container
4242 */
4243function _api4_load_services($namespace, $tag, $container) {
4244
4245
4246ERROR: MissingReturnType - api4.php:101:10 - Method _api4_load_services does not have a return type, expecting void
4247function _api4_load_services($namespace, $tag, $container) {
4248
4249
4250ERROR: MissingReturnType - api4.php:118:10 - Method api4_civicrm_coreResourceList does not have a return type, expecting void
4251function api4_civicrm_coreResourceList(&$list, $region) {
4252
4253
4254ERROR: MissingParamType - api4.php:118:41 - Parameter $list has no provided type
4255function api4_civicrm_coreResourceList(&$list, $region) {
4256
4257
4258ERROR: MissingParamType - api4.php:118:48 - Parameter $region has no provided type
4259function api4_civicrm_coreResourceList(&$list, $region) {
4260
4261
4262ERROR: UndefinedClass - api4.php:120:5 - Class or interface Civi does not exist
4263 Civi::resources()->addScriptFile('org.civicrm.api4', 'js/api4.js', -9000, $region);
4264
4265
4266ERROR: MissingReturnType - api4.php:129:10 - Method api4_civicrm_config does not have a return type, expecting void
4267function api4_civicrm_config(&$config) {
4268
4269
4270ERROR: MissingParamType - api4.php:129:31 - Parameter $config has no provided type
4271function api4_civicrm_config(&$config) {
4272
4273
4274ERROR: MissingReturnType - api4.php:138:10 - Method api4_civicrm_xmlMenu does not have a return type, expecting void
4275function api4_civicrm_xmlMenu(&$files) {
4276
4277
4278ERROR: MissingParamType - api4.php:138:32 - Parameter $files has no provided type
4279function api4_civicrm_xmlMenu(&$files) {
4280
4281
4282ERROR: MissingReturnType - api4.php:147:10 - Method api4_civicrm_install does not have a return type, expecting void
4283function api4_civicrm_install() {
4284
4285
4286ERROR: MissingReturnType - api4.php:156:10 - Method api4_civicrm_uninstall does not have a return type, expecting void
4287function api4_civicrm_uninstall() {
4288
4289
4290ERROR: MissingReturnType - api4.php:165:10 - Method api4_civicrm_enable does not have a return type, expecting void
4291function api4_civicrm_enable() {
4292
4293
4294ERROR: MissingReturnType - api4.php:174:10 - Method api4_civicrm_disable does not have a return type, expecting void
4295function api4_civicrm_disable() {
4296
4297
4298ERROR: MissingReturnType - api4.php:183:10 - Method api4_civicrm_upgrade does not have a return type
4299function api4_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
4300
4301
4302ERROR: UndefinedClass - api4.php:183:36 - Class or interface CRM_Queue_Queue does not exist
4303function api4_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
4304
4305
4306ERROR: MissingReturnType - api4.php:195:10 - Method api4_civicrm_managed does not have a return type, expecting void
4307function api4_civicrm_managed(&$entities) {
4308
4309
4310ERROR: MissingParamType - api4.php:195:32 - Parameter $entities has no provided type
4311function api4_civicrm_managed(&$entities) {
4312
4313
4314ERROR: MissingReturnType - api4.php:209:10 - Method api4_civicrm_angularModules does not have a return type, expecting void
4315function api4_civicrm_angularModules(&$angularModules) {
4316
4317
4318ERROR: MissingParamType - api4.php:209:39 - Parameter $angularModules has no provided type
4319function api4_civicrm_angularModules(&$angularModules) {
4320
4321
4322ERROR: MissingReturnType - api4.php:218:10 - Method api4_civicrm_alterSettingsFolders does not have a return type, expecting void
4323function api4_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
4324
4325
4326ERROR: MissingParamType - api4.php:218:45 - Parameter $metaDataFolders has no provided type
4327function api4_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
4328
4329
4330ERROR: MissingDependency - tests/phpunit/Action/BaseCustomValueTest.php:8:44 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4331abstract class BaseCustomValueTest extends UnitTestCase {
4332
4333
4334ERROR: MissingDependency - tests/phpunit/Action/BasicActionsTest.php:11:32 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4335class BasicActionsTest extends UnitTestCase {
4336
4337
4338ERROR: MissingDependency - tests/phpunit/Action/BasicCustomFieldTest.php:12:36 - Civi\Test\Api4\Action\BaseCustomValueTest depends on class or interface phpunit_framework_testcase that does not exist
4339class BasicCustomFieldTest extends BaseCustomValueTest {
4340
4341
4342ERROR: MissingDependency - tests/phpunit/Action/ChainTest.php:10:25 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4343class ChainTest extends UnitTestCase {
4344
4345
4346ERROR: MissingDependency - tests/phpunit/Action/ComplexQueryTest.php:14:32 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4347class ComplexQueryTest extends UnitTestCase {
4348
4349
4350ERROR: MissingDependency - tests/phpunit/Action/ContactApiKeyTest.php:10:33 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4351class ContactApiKeyTest extends \Civi\Test\Api4\UnitTestCase {
4352
4353
4354ERROR: MissingDependency - tests/phpunit/Action/ContactChecksumTest.php:10:35 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4355class ContactChecksumTest extends \Civi\Test\Api4\UnitTestCase {
4356
4357
4358ERROR: MissingDependency - tests/phpunit/Action/CreateCustomValueTest.php:13:37 - Civi\Test\Api4\Action\BaseCustomValueTest depends on class or interface phpunit_framework_testcase that does not exist
4359class CreateCustomValueTest extends BaseCustomValueTest {
4360
4361
4362ERROR: MissingDependency - tests/phpunit/Action/CreateWithOptionGroupTest.php:12:41 - Civi\Test\Api4\Action\BaseCustomValueTest depends on class or interface phpunit_framework_testcase that does not exist
4363class CreateWithOptionGroupTest extends BaseCustomValueTest {
4364
4365
4366ERROR: MissingDependency - tests/phpunit/Action/CurrentFilterTest.php:12:33 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4367class CurrentFilterTest extends UnitTestCase {
4368
4369
4370ERROR: MissingDependency - tests/phpunit/Action/CustomValuePerformanceTest.php:13:42 - Civi\Test\Api4\Action\BaseCustomValueTest depends on class or interface phpunit_framework_testcase that does not exist
4371class CustomValuePerformanceTest extends BaseCustomValueTest {
4372
4373
4374ERROR: MissingDependency - tests/phpunit/Action/CustomValueTest.php:13:31 - Civi\Test\Api4\Action\BaseCustomValueTest depends on class or interface phpunit_framework_testcase that does not exist
4375class CustomValueTest extends BaseCustomValueTest {
4376
4377
4378ERROR: MissingDependency - tests/phpunit/Action/DateTest.php:12:24 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4379class DateTest extends UnitTestCase {
4380
4381
4382ERROR: MissingDependency - tests/phpunit/Action/EvaluateConditionTest.php:11:37 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4383class EvaluateConditionTest extends UnitTestCase {
4384
4385
4386ERROR: MissingDependency - tests/phpunit/Action/ExtendFromIndividualTest.php:12:40 - Civi\Test\Api4\Action\BaseCustomValueTest depends on class or interface phpunit_framework_testcase that does not exist
4387class ExtendFromIndividualTest extends BaseCustomValueTest {
4388
4389
4390ERROR: MissingDependency - tests/phpunit/Action/FkJoinTest.php:12:26 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4391class FkJoinTest extends UnitTestCase {
4392
4393
4394ERROR: MissingDependency - tests/phpunit/Action/GetExtraFieldsTest.php:11:34 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4395class GetExtraFieldsTest extends UnitTestCase {
4396
4397
4398ERROR: MissingDependency - tests/phpunit/Action/GetFromArrayTest.php:11:32 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4399class GetFromArrayTest extends UnitTestCase {
4400
4401
4402ERROR: MissingDependency - tests/phpunit/Action/IndexTest.php:10:25 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4403class IndexTest extends UnitTestCase {
4404
4405
4406ERROR: MissingDependency - tests/phpunit/Action/NullValueTest.php:11:29 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4407class NullValueTest extends UnitTestCase {
4408
4409
4410ERROR: MissingDependency - tests/phpunit/Action/ReplaceTest.php:16:27 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4411class ReplaceTest extends UnitTestCase {
4412
4413
4414ERROR: MissingDependency - tests/phpunit/Action/UpdateContactTest.php:13:33 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4415class UpdateContactTest extends UnitTestCase {
4416
4417
4418ERROR: MissingDependency - tests/phpunit/Action/UpdateCustomValueTest.php:13:37 - Civi\Test\Api4\Action\BaseCustomValueTest depends on class or interface phpunit_framework_testcase that does not exist
4419class UpdateCustomValueTest extends BaseCustomValueTest {
4420
4421
4422ERROR: MissingDependency - tests/phpunit/Entity/ConformanceTest.php:14:31 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4423class ConformanceTest extends UnitTestCase {
4424
4425
4426ERROR: MissingDependency - tests/phpunit/Entity/ContactJoinTest.php:12:31 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4427class ContactJoinTest extends UnitTestCase {
4428
4429
4430ERROR: MissingDependency - tests/phpunit/Entity/EntityTest.php:11:26 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4431class EntityTest extends UnitTestCase {
4432
4433
4434ERROR: MissingDependency - tests/phpunit/Entity/ParticipantTest.php:11:31 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4435class ParticipantTest extends UnitTestCase {
4436
4437
4438ERROR: MissingDependency - tests/phpunit/Entity/SettingTest.php:11:27 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4439class SettingTest extends UnitTestCase {
4440
4441
4442ERROR: MissingReturnType - tests/phpunit/Mock/Api4/MockArrayEntity.php:15:26 - Method Civi\Api4\MockArrayEntity::getFields does not have a return type, expecting Civi\Api4\Generic\BasicGetFieldsAction
4443 public static function getFields() {
4444
4445
4446ERROR: MissingClosureParamType - tests/phpunit/Mock/Api4/MockBasicEntity.php:79:102 - Parameter $item has no provided type
4447 return new Generic\BasicBatchAction('MockBasicEntity', __FUNCTION__, ['id', 'number'], function ($item) {
4448
4449
4450ERROR: MixedArrayAccess - tests/phpunit/Mock/Api4/MockBasicEntity.php:81:17 - Cannot access array value on mixed variable $item
4451 'id' => $item['id'],
4452
4453
4454ERROR: MixedArrayAccess - tests/phpunit/Mock/Api4/MockBasicEntity.php:82:27 - Cannot access array value on mixed variable $item
4455 'frobnication' => $item['number'] * $item['number'],
4456
4457
4458ERROR: MixedOperand - tests/phpunit/Mock/Api4/MockBasicEntity.php:82:27 - Left operand cannot be mixed
4459 'frobnication' => $item['number'] * $item['number'],
4460
4461
4462ERROR: MissingPropertyType - tests/phpunit/Mock/MockEntityDataStorage.php:10:18 - Property Civi\Test\Api4\Mock\MockEntityDataStorage::$data does not have a declared type - consider array
4463 private static $data = [];
4464
4465
4466ERROR: MissingPropertyType - tests/phpunit/Mock/MockEntityDataStorage.php:12:18 - Property Civi\Test\Api4\Mock\MockEntityDataStorage::$nextId does not have a declared type - consider int
4467 private static $nextId = 1;
4468
4469
4470ERROR: MissingReturnType - tests/phpunit/Mock/MockEntityDataStorage.php:14:26 - Method Civi\Test\Api4\Mock\MockEntityDataStorage::get does not have a return type
4471 public static function get() {
4472
4473
4474ERROR: MissingReturnType - tests/phpunit/Mock/MockEntityDataStorage.php:18:26 - Method Civi\Test\Api4\Mock\MockEntityDataStorage::write does not have a return type
4475 public static function write($record) {
4476
4477
4478ERROR: MissingParamType - tests/phpunit/Mock/MockEntityDataStorage.php:18:32 - Parameter $record has no provided type
4479 public static function write($record) {
4480
4481
4482ERROR: MixedAssignment - tests/phpunit/Mock/MockEntityDataStorage.php:20:7 - Cannot assign to a mixed type
4483 $record['id'] = self::$nextId++;
4484
4485
4486ERROR: MixedOperand - tests/phpunit/Mock/MockEntityDataStorage.php:20:23 - Left operand cannot be mixed
4487 $record['id'] = self::$nextId++;
4488
4489
4490ERROR: MixedAssignment - tests/phpunit/Mock/MockEntityDataStorage.php:22:5 - Cannot assign to a mixed type
4491 self::$data[$record['id']] = $record;
4492
4493
4494ERROR: MixedArrayAccess - tests/phpunit/Mock/MockEntityDataStorage.php:22:17 - Cannot access array value on mixed variable $record
4495 self::$data[$record['id']] = $record;
4496
4497
4498ERROR: MissingReturnType - tests/phpunit/Mock/MockEntityDataStorage.php:26:26 - Method Civi\Test\Api4\Mock\MockEntityDataStorage::delete does not have a return type
4499 public static function delete($record) {
4500
4501
4502ERROR: MissingParamType - tests/phpunit/Mock/MockEntityDataStorage.php:26:33 - Parameter $record has no provided type
4503 public static function delete($record) {
4504
4505
4506ERROR: MixedArrayAccess - tests/phpunit/Mock/MockEntityDataStorage.php:27:11 - Cannot access array value on mixed variable Civi\Test\Api4\Mock\MockEntityDataStorage::$data
4507 unset(self::$data[$record['id']]);
4508
4509
4510ERROR: MixedArrayOffset - tests/phpunit/Mock/MockEntityDataStorage.php:27:11 - Cannot access value on variable Civi\Test\Api4\Mock\MockEntityDataStorage::$data using mixed offset
4511 unset(self::$data[$record['id']]);
4512
4513
4514ERROR: MixedArrayAccess - tests/phpunit/Mock/MockEntityDataStorage.php:27:23 - Cannot access array value on mixed variable $record
4515 unset(self::$data[$record['id']]);
4516
4517
4518ERROR: MissingDependency - tests/phpunit/Query/Api4SelectQueryComplexJoinTest.php:11:46 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4519class Api4SelectQueryComplexJoinTest extends UnitTestCase {
4520
4521
4522ERROR: MissingDependency - tests/phpunit/Query/Api4SelectQueryTest.php:11:35 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4523class Api4SelectQueryTest extends UnitTestCase {
4524
4525
4526ERROR: MissingDependency - tests/phpunit/Query/OneToOneJoinTest.php:15:32 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4527class OneToOneJoinTest extends UnitTestCase {
4528
4529
4530ERROR: MissingDependency - tests/phpunit/Query/OptionValueJoinTest.php:11:35 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4531class OptionValueJoinTest extends UnitTestCase {
4532
4533
4534ERROR: MissingDependency - tests/phpunit/Query/SelectQueryMultiJoinTest.php:14:40 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4535class SelectQueryMultiJoinTest extends UnitTestCase {
4536
4537
4538ERROR: MissingDependency - tests/phpunit/Service/Schema/SchemaMapRealTableTest.php:10:38 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4539class SchemaMapRealTableTest extends UnitTestCase {
4540
4541
4542ERROR: MissingDependency - tests/phpunit/Service/Schema/SchemaMapperTest.php:13:32 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4543class SchemaMapperTest extends UnitTestCase {
4544
4545
4546ERROR: MissingParamType - tests/phpunit/Service/TestCreationParameterProvider.php:28:31 - Parameter $entity has no provided type
4547 public function getRequired($entity) {
4548
4549
4550ERROR: MixedArgument - tests/phpunit/Service/TestCreationParameterProvider.php:29:44 - Argument 1 of Civi\Api4\Service\Spec\SpecGatherer::getspec cannot be mixed, expecting string
4551 $createSpec = $this->gatherer->getSpec($entity, 'create', FALSE);
4552
4553
4554ERROR: MixedAssignment - tests/phpunit/Service/TestCreationParameterProvider.php:38:33 - Cannot assign $requiredField to a mixed type
4555 foreach ($requiredFields as $requiredField) {
4556
4557
4558ERROR: MixedAssignment - tests/phpunit/Service/TestCreationParameterProvider.php:39:7 - Cannot assign $value to a mixed type
4559 $value = $this->getRequiredValue($requiredField);
4560
4561
4562ERROR: MixedArgument - tests/phpunit/Service/TestCreationParameterProvider.php:39:40 - Argument 1 of Civi\Test\Api4\Service\TestCreationParameterProvider::getrequiredvalue cannot be mixed, expecting Civi\Api4\Service\Spec\FieldSpec
4563 $value = $this->getRequiredValue($requiredField);
4564
4565
4566ERROR: MixedAssignment - tests/phpunit/Service/TestCreationParameterProvider.php:40:7 - Cannot assign to a mixed type
4567 $requiredParams[$requiredField->getName()] = $value;
4568
4569
4570ERROR: MixedArrayOffset - tests/phpunit/Service/TestCreationParameterProvider.php:40:7 - Cannot access value on variable $requiredParams[mixed] using mixed offset
4571 $requiredParams[$requiredField->getName()] = $value;
4572
4573
4574ERROR: MixedMethodCall - tests/phpunit/Service/TestCreationParameterProvider.php:40:39 - Cannot determine the type of the object on the left hand side of this expression
4575 $requiredParams[$requiredField->getName()] = $value;
4576
4577
4578ERROR: UndefinedFunction - tests/phpunit/Service/TestCreationParameterProvider.php:101:19 - Function Civi\Test\Api4\Service\civicrm_api4 does not exist
4579 $entityList = civicrm_api4($fkEntity, 'get', $params);
4580
4581
4582ERROR: MixedInferredReturnType - tests/phpunit/Service/TestCreationParameterProvider.php:113:14 - Could not verify return type 'int|null|string' for Civi\Test\Api4\Service\TestCreationParameterProvider::getRandomValue
4583 /**
4584 * @param $dataType
4585 *
4586 * @return int|null|string
4587 */
4588 private function getRandomValue($dataType) {
4589 switch ($dataType) {
4590 case 'Boolean':
4591 return TRUE;
4592
4593 case 'Integer':
4594 return rand(1, 2000);
4595
4596 case 'String':
4597
4598
4599ERROR: MissingParamType - tests/phpunit/Service/TestCreationParameterProvider.php:115:35 - Parameter $dataType has no provided type
4600 private function getRandomValue($dataType) {
4601
4602
4603ERROR: InvalidReturnStatement - tests/phpunit/Service/TestCreationParameterProvider.php:118:16 - The type 'true' does not match the declared return type 'int|null|string' for Civi\Test\Api4\Service\TestCreationParameterProvider::getRandomValue
4604 return TRUE;
4605
4606
4607ERROR: UndefinedClass - tests/phpunit/Service/TestCreationParameterProvider.php:124:16 - Class or interface CRM_Utils_String does not exist
4608 return StringHelper::createRandom(10, implode('', range('a', 'z')));
4609
4610
4611ERROR: UndefinedClass - tests/phpunit/Service/TestCreationParameterProvider.php:127:16 - Class or interface CRM_Utils_String does not exist
4612 return StringHelper::createRandom(100, implode('', range('a', 'z')));
4613
4614
4615ERROR: MissingDependency - tests/phpunit/Spec/RequestSpecTest.php:12:31 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4616class RequestSpecTest extends UnitTestCase {
4617
4618
4619ERROR: MissingDependency - tests/phpunit/Spec/SpecFormatterTest.php:14:33 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4620class SpecFormatterTest extends UnitTestCase {
4621
4622
4623ERROR: MissingDependency - tests/phpunit/Spec/SpecGathererTest.php:19:32 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4624class SpecGathererTest extends UnitTestCase {
4625
4626
4627ERROR: UndefinedClass - tests/phpunit/UnitTestCase.php:12:28 - Class or interface PHPUnit_Framework_TestCase does not exist
4628class UnitTestCase extends \PHPUnit_Framework_TestCase implements HeadlessInterface, TransactionalInterface {
4629
4630
4631ERROR: MissingDependency - tests/phpunit/Utils/ArrayInsertionServiceTest.php:11:41 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4632class ArrayInsertionServiceTest extends UnitTestCase {
4633
4634
4635ERROR: MissingDependency - tests/phpunit/Utils/ReflectionUtilsTest.php:12:35 - Civi\Test\Api4\UnitTestCase depends on class or interface phpunit_framework_testcase that does not exist
4636class ReflectionUtilsTest extends UnitTestCase {
4637
4638
4639ERROR: InvalidScalarArgument - tests/phpunit/bootstrap.php:5:22 - Argument 2 of ini_set expects string, int(0) provided
4640ini_set('safe_mode', 0);
4641
4642
4643ERROR: MixedAssignment - tests/phpunit/bootstrap.php:10:1 - Cannot assign $loader to a mixed type
4644$loader = require sprintf('%s/vendor/autoload.php', $matches[1]);
4645
4646
4647ERROR: UnresolvableInclude - tests/phpunit/bootstrap.php:10:11 - Cannot resolve the given expression to a file path
4648$loader = require sprintf('%s/vendor/autoload.php', $matches[1]);
4649
4650
4651ERROR: MixedInferredReturnType - tests/phpunit/bootstrap.php:21:12 - Could not verify return type 'string' for cv
4652/**
4653 * Call the "cv" command.
4654 *
4655 * @param string $cmd
4656 * The rest of the command to send.
4657 * @param string $decode
4658 * Ex: 'json' or 'phpcode'.
4659 * @return string
4660 * Response output (if the command executed normally).
4661 * @throws \RuntimeException
4662 * If the command terminates abnormally.
4663 */
4664function cv($cmd, $decode = 'json') {
4665 $cmd = 'cv ' . $cmd;
4666
4667
4668ERROR: MixedReturnStatement - tests/phpunit/bootstrap.php:51:14 - Could not infer a return type
4669 return json_decode($result, 1);
4670
4671
4672ERROR: InvalidScalarArgument - tests/phpunit/bootstrap.php:51:35 - Argument 2 of json_decode expects bool, int(1) provided
4673 return json_decode($result, 1);
4674
4675
4676------------------------------
4677998 errors found
4678------------------------------
4679
4680Checks took 9.26 seconds and used 180.152MB of memory
4681Psalm was able to infer types for 84.4945% of the codebase