2
0
forked from Wavyzz/dolibarr

fix phpstan (#32010)

* fix phpstan

* Update extrafields_view.tpl.php

* Update extrafields.class.php
This commit is contained in:
Frédéric FRANCE
2024-11-20 20:56:16 +01:00
committed by GitHub
parent a9b2e7bde1
commit b7816bf648
2 changed files with 3 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ class ExtraFields
public $attributes = array(); public $attributes = array();
/** /**
* @var array<string,bool|int<0,1>> Array with boolean of status of groups * @var array<string,bool|int<0,1>>|null Array with boolean of status of groups
*/ */
public $expand_display; public $expand_display;

View File

@@ -29,6 +29,7 @@
* @var CommonObject $object * @var CommonObject $object
* @var Conf $conf * @var Conf $conf
* @var DoliDB $db * @var DoliDB $db
* @var ExtraFields $extrafields
* @var Form $form * @var Form $form
* @var Translate $langs * @var Translate $langs
* @var User $user * @var User $user
@@ -81,7 +82,7 @@ if (empty($reshook) && !empty($object->table_element) && isset($extrafields->att
$enabled = 1; $enabled = 1;
if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra])) { if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra])) {
$enabled = (int) dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1, 1, '2'); $enabled = (int) dol_eval((string) $extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1, 1, '2');
} }
if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra])) { if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra])) {
$enabled = (int) dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1, 1, '2'); $enabled = (int) dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1, 1, '2');