Qual: Fix phan notices (#31193)

# Qual: Fix phan notices

Fix phan notices in several classes that have UnknownObjectMethod calls and classes
that had notices in relation with these classes
This commit is contained in:
MDW
2024-09-30 10:05:24 +02:00
committed by GitHub
parent 1754ee61d5
commit 8236aed22f
42 changed files with 618 additions and 221 deletions

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2021 John BOTELLA <john.botella@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -261,7 +262,7 @@ class Validate
/**
* Check for all values in db
*
* @param array $values Boolean to validate
* @param string[] $values Boolean to validate
* @param string $table the db table name without $this->db->prefix()
* @param string $col the target col
* @return boolean Validity is ok or not
@@ -313,6 +314,7 @@ class Validate
if ($classname && class_exists($classname)) {
/** @var CommonObject $object */
$object = new $classname($this->db);
'@phan-var-force CommonObject|User $object'; // User provided to propose a class with 'fetch'
if (!is_callable(array($object, 'fetch')) || !is_callable(array($object, 'isExistingObject'))) {
$this->error = $this->outputLang->trans('BadSetupOfFieldFetchNotCallable');