Qual: Fix PhanTypeExpectedObjectOrClassName by testing on classname

# Qual: Fix PhanTypeExpectedObjectOrClassName by testing on classname

PhanTypeExpectedObjectOrClassName should be fixed by testing that the classname is not
empty.
This commit is contained in:
MDW 2024-03-12 16:16:24 +01:00
parent 05408a1893
commit bcd692ef6a
No known key found for this signature in database

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -99,18 +100,16 @@ if ($action == 'updateMask') {
// Search template files
$file = '';
$classname = '';
$filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/webhook/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
if (file_exists($file)) {
$filefound = 1;
$classname = "pdf_".$modele."_".strtolower($tmpobjectkey);
break;
}
}
if ($filefound) {
if ($classname !== '') {
require_once $file;
$module = new $classname($db);