-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Qual: Fix FunctionArray phan notices (#31754)
* Qual: Fix FunctionArray phan notices * Fix class name in typing of htdocs/modulebuilder/index.php * Fix customreports phpdoc * Adjust file type after completeFileArrayWithDatabaseInfo * Further phpdoc typing improvements * More phpdoc * Improve typing with cast on position field * Force phpstan version * Add phpstan exception * Fix array index type + adjust phan config comment
- Loading branch information
Showing
44 changed files
with
616 additions
and
738 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/* Copyright (C) 2021 Open-Dsi <[email protected]> | ||
* Copyright (C) 2024 Frédéric France <[email protected]> | ||
* Copyright (C) 2024 José <[email protected]> | ||
* Copyright (C) 2024 MDW <[email protected]> | ||
* | ||
* 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 | ||
|
@@ -31,7 +32,19 @@ | |
* @var DoliDB $db | ||
* @var Form $form | ||
* @var HookManager $hookmanager | ||
* @var AssetDepreciationOptions $assetdepreciationoptions | ||
* @var Translate $langs | ||
* @var ?array<array{mode_key:string,field_key:string,value:string,target:string}> $enabled_field_info | ||
*/ | ||
' | ||
@phan-var-force Conf $conf | ||
@phan-var-force DoliDB $db | ||
@phan-var-force ?Form $form | ||
@phan-var-force HookManager $hookmanager | ||
@phan-var-force AssetDepreciationOptions $assetdepreciationoptions | ||
@phan-var-force Translate $langs | ||
@phan-var-force ?array<array{mode_key:string,field_key:string,value:string,target:string}> $enabled_field_info | ||
'; | ||
|
||
// Protection to avoid direct call of template | ||
if (empty($object) || !is_object($object)) { | ||
|
@@ -84,7 +97,7 @@ | |
|
||
$assetdepreciationoptions->setInfosForMode($mode_key, $class_type, true); | ||
$prefix_html_name = $mode_key . '_'; | ||
$width = ($mode_key == "economic")? "width50p pull-left" : "width50p"; | ||
$width = ($mode_key == "economic") ? "width50p pull-left" : "width50p"; | ||
print '<table class="border '. $width .'" id="block_' . $mode_key . '">' . "\n"; | ||
print '<tr><td class="info-box-title">'.$langs->trans($mode_info['label']).'</td></tr>'; | ||
if ($mode_key == "economic") { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* Copyright (C) 2005-2012 Regis Houssin <[email protected]> | ||
* Copyright (C) 2007 Patrick Raguin <[email protected]> | ||
* Copyright (C) 2020-2024 Frédéric France <[email protected]> | ||
* Copyright (C) 2024 MDW <[email protected]> | ||
* | ||
* 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 | ||
|
@@ -77,7 +78,7 @@ | |
|
||
$type = $object->type; | ||
if (is_numeric($type)) { | ||
$type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility | ||
$type = Categorie::$MAP_ID_TO_CODE[(int) $type]; // For backward compatibility | ||
} | ||
|
||
$extrafields = new ExtraFields($db); | ||
|
@@ -89,7 +90,7 @@ | |
/* | ||
* Actions | ||
*/ | ||
$parameters = array('id' => $id, 'ref' => $ref, 'cancel'=> $cancel, 'backtopage' => $backtopage, 'socid' => $socid, 'label' => $label, 'description' => $description, 'color' => $color, 'position' => $position, 'visible' => $visible, 'parent' => $parent); | ||
$parameters = array('id' => $id, 'ref' => $ref, 'cancel' => $cancel, 'backtopage' => $backtopage, 'socid' => $socid, 'label' => $label, 'description' => $description, 'color' => $color, 'position' => $position, 'visible' => $visible, 'parent' => $parent); | ||
// Note that $action and $object may be modified by some hooks | ||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); | ||
if ($reshook < 0) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
* Copyright (C) 2005-2009 Regis Houssin <[email protected]> | ||
* Copyright (C) 2017 Ferran Marcet <[email protected]> | ||
* Copyright (C) 2024 Frédéric France <[email protected]> | ||
* Copyright (C) 2024 MDW <[email protected]> | ||
* | ||
* 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 | ||
|
@@ -64,7 +65,7 @@ | |
|
||
$type = $object->type; | ||
if (is_numeric($type)) { | ||
$type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility | ||
$type = Categorie::$MAP_ID_TO_CODE[(int) $type]; // For backward compatibility | ||
} | ||
|
||
/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* Copyright (C) 2010-2016 Destailleur Laurent <[email protected]> | ||
* Copyright (C) 2015 Raphaël Doursenaud <[email protected]> | ||
* Copyright (C) 2024 Frédéric France <[email protected]> | ||
* Copyright (C) 2024 MDW <[email protected]> | ||
* | ||
* 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 | ||
|
@@ -65,7 +66,7 @@ | |
|
||
$type = $object->type; | ||
if (is_numeric($type)) { | ||
$type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility | ||
$type = Categorie::$MAP_ID_TO_CODE[(int) $type]; // For backward compatibility | ||
} | ||
|
||
// Security check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.