Qual: Fix phan notices (theme)

This commit is contained in:
MDW 2025-02-19 12:25:06 +01:00
parent 3956de0b96
commit 272808cc9b
No known key found for this signature in database
12 changed files with 130 additions and 19 deletions

View File

@ -13,9 +13,9 @@ return [
// PhanUndeclaredProperty : 500+ occurrences
// PhanTypeMismatchArgumentNullable : 320+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 170+ occurrences
// PhanUndeclaredGlobalVariable : 160+ occurrences
// PhanTypeMismatchProperty : 120+ occurrences
// PhanPluginUnknownArrayMethodParamType : 110+ occurrences
// PhanUndeclaredGlobalVariable : 100+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 35+ occurrences
// PhanTypeExpectedObjectPropAccess : 30+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 25+ occurrences
@ -33,7 +33,6 @@ return [
// PhanEmptyFQSENInClasslike : 3 occurrences
// PhanInvalidFQSENInClasslike : 3 occurrences
// PhanPluginSuspiciousParamPosition : 3 occurrences
// PhanRedefineFunction : 2 occurrences
// PhanTypeMismatchDimAssignment : 2 occurrences
// PhanTypeSuspiciousStringExpression : 2 occurrences
// PhanAccessMethodProtected : 1 occurrence
@ -644,17 +643,6 @@ return [
'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/takepos/invoice.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/theme/eldy/badges.inc.php' => ['PhanRedefineFunction'],
'htdocs/theme/eldy/btn.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/eldy/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/eldy/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/eldy/main_menu_fa_icons.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/eldy/progress.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/md/badges.inc.php' => ['PhanRedefineFunction'],
'htdocs/theme/md/btn.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/md/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/md/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/md/progress.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/ticket/agenda.php' => ['PhanTypeMismatchArgument'],
'htdocs/ticket/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/ticket/class/actions_ticket.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*/
if (!defined('ISLOADEDBYSTEELSHEET')) {
@ -254,6 +254,8 @@ _createStatusBadgeCss('4b', '', "STATUS4b");
* @param string $commentLabel a comment label
* @param string $cssPrefix a css prefix
* @return void
*
* @phan-suppress PhanRedefineFunction
*/
function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentLabel = '', $cssPrefix = '')
{

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*/
if (!defined('ISLOADEDBYSTEELSHEET')) {
die('Must be call by steelsheet');
@ -12,9 +13,21 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
* @var string $colortextlink
* @var int $dol_optimize_smallscreen
* @var string $textbutaction
* @var int<0,max> $nbtopmenuentries
* @var string $right
* @var string $left
*/
'
@phan-var-force string $butactionbg
@phan-var-force string $colortextlink
@phan-var-force int<0,1> $dol_optimize_smallscreen
@phan-var-force string $fontlist
@phan-var-force string $left
@phan-var-force int<0,max> $nbtopmenuentries
@phan-var-force string $right
@phan-var-force string $textbutaction
';
?>
/* IDE Hack <style type="text/css"> */

View File

@ -1,8 +1,28 @@
<?php
/* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*/
if (!defined('ISLOADEDBYSTEELSHEET')) {
die('Must be call by steelsheet');
}
include_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php";
/**
* @var string $colorbackhmenu1
* @var string $colorbacklinepair1
* @var string $colortextbackhmenu
* @var string $colortextlink
* @var int<0,1> $disableimages
* @var string $left
* @var string $right
*/
'
@phan-var-force string $colorbackhmenu1
@phan-var-force string $colorbacklinepair1
@phan-var-force string $colortextbackhmenu
@phan-var-force string $colortextlink
@phan-var-force int<0,1> $disableimages
@phan-var-force string $left
@phan-var-force string $right
';
?>
/* IDE Hack <style type="text/css"> */

View File

@ -1,7 +1,7 @@
<?php
/*
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 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
@ -27,6 +27,9 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
/**
* @var string $path
*/
'
@phan-var-force string $path
';
?>
/* IDE Hack <style type="text/css"> */

View File

@ -1,7 +1,7 @@
<?php
/*
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 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
@ -24,6 +24,22 @@
if (!defined('ISLOADEDBYSTEELSHEET')) {
die('Must be call by stylesheet');
}
/**
* @var string $badgeDanger
* @var string $badgeSuccess
* @var string $badgeWarning
* @var string $colorblind_deuteranopes_badgeDanger
* @var string $colorblind_deuteranopes_badgeSuccess
* @var string $topMenuFontSize
*/
'
@phan-var-force string $badgeDanger
@phan-var-force string $badgeSuccess
@phan-var-force string $badgeWarning
@phan-var-force string $colorblind_deuteranopes_badgeDanger
@phan-var-force string $colorblind_deuteranopes_badgeSuccess
@phan-var-force string $topMenuFontSize
';
?>
/* IDE Hack <style type="text/css"> */

View File

@ -1,7 +1,24 @@
<?php
/* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*/
if (!defined('ISLOADEDBYSTEELSHEET')) {
die('Must be call by steelsheet');
} ?>
}
/**
* @var string $badgeDanger
* @var string $badgeSuccess
* @var string $badgeWarning
* @var string $colorblind_deuteranopes_badgeDanger
* @var string $colorblind_deuteranopes_badgeSuccess
*/
'
@phan-var-force string $badgeDanger
@phan-var-force string $badgeSuccess
@phan-var-force string $badgeWarning
@phan-var-force string $colorblind_deuteranopes_badgeDanger
@phan-var-force string $colorblind_deuteranopes_badgeSuccess
'
?>
/* IDE Hack <style type="text/css"> */

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
*/
if (!defined('ISLOADEDBYSTEELSHEET')) {
@ -257,6 +257,8 @@ _createStatusBadgeCss('4b', '', "STATUS4b");
* @param string $commentLabel a comment label
* @param string $cssPrefix a css prefix
* @return void
*
* @phan-suppress PhanRedefineFunction
*/
function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentLabel = '', $cssPrefix = '')
{

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*/
if (!defined('ISLOADEDBYSTEELSHEET')) {
die('Must be call by steelsheet');
@ -12,6 +13,16 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
* @var string $butactionbg
* @var string $textbutaction
*/
'
@phan-var-force string $butactionbg
@phan-var-force string $colortextlink
@phan-var-force int $dol_optimize_smallscreen
@phan-var-force string $fontlist
@phan-var-force string $left
@phan-var-force int $nbtopmenuentries
@phan-var-force string $right
@phan-var-force string $textbutaction
';
?>
/* IDE Hack <style type="text/css"> */

View File

@ -1,4 +1,6 @@
<?php
/* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*/
if (!defined('ISLOADEDBYSTEELSHEET')) {
die('Must be call by steelsheet');
}
@ -6,6 +8,25 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
// When no photo, we show the login name, so we need an offset to output picto at a fixed position.
$atoploginusername = empty($user->photo) ? 52 : 0;
/**
* @var string $colorbackhmenu1
* @var string $colorbacklinepair1
* @var string $colortextbackhmenu
* @var string $colortextlink
* @var int<0,1> $disableimages
* @var string $left
* @var string $right
*/
'
@phan-var-force string $colorbackhmenu1
@phan-var-force string $colorbacklinepair1
@phan-var-force string $colortextbackhmenu
@phan-var-force string $colortextlink
@phan-var-force int<0,1> $disableimages
@phan-var-force string $left
@phan-var-force string $right
';
?>
/* IDE Hack <style type="text/css"> */

View File

@ -1,7 +1,16 @@
<?php
/* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*/
if (!defined('ISLOADEDBYSTEELSHEET')) {
die('Must be call by steelsheet');
} ?>
}
/**
* @var string $path
*/
'
@phan-var-force string $path
';
?>
/* IDE Hack <style type="text/css"> */

View File

@ -1,6 +1,15 @@
<?php
/* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*/
if (!defined('ISLOADEDBYSTEELSHEET')) {
die('Must be call by steelsheet');
}
/**
* @var string $path
*/
'
@phan-var-force string $path
';
include dol_buildpath($path.'/theme/eldy/progress.inc.php', 0); // actually md use same style as eldy theme