Améliorations de code et corrections de comportement (PHPStan lvl 1)#3260
Open
kwizer15 wants to merge 4 commits into
Open
Améliorations de code et corrections de comportement (PHPStan lvl 1)#3260kwizer15 wants to merge 4 commits into
kwizer15 wants to merge 4 commits into
Conversation
Mips2648
requested changes
Apr 17, 2026
kwizer15
commented
Apr 17, 2026
Mips2648
approved these changes
Apr 20, 2026
Collaborator
|
ok for me |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Corrections qui améliorent la robustesse du code, détectées par PHPStan au niveau 1. Contrairement aux autres PRs de cette série, certaines de ces modifications changent légèrement le comportement pour corriger des problèmes réels.
Corrections de comportement :
cmd::historyInfluxAll()— Remplacement de l'appel direct àhistoryInflux('all')par la création d'une tâche cron dédiée, évitant un timeout sur les gros volumesjeeObject.class.php— Réordonnancement du guardclass_exists('virtual')avant l'appel à$plugin->isActive()pour éviter un crash si la classe n'est pas chargéenetwork.class.php— Ajout declass_exists('openvpn')dans le guard pour la même raisonjsonrpcClient.class.php— Remplacement duwhilepardo...while(la boucle doit s'exécuter au moins une fois)scenario::export()— Ajout dereturnexplicites dans chaque branche pour éviter unreturnambigu en fin de méthodecore/php/utils.inc.phpredirect()—exit(header(...))remplacé parheader(); exitcarheader()retourne voidcore/php/utils.inc.phpevaluate()— Restructuration du bloc if/else pour protéger correctement les chaînes entre guillemetsNettoyage sans changement de comportement :
plugin.class.php— Suppression duisset($listPlugin)redondant (la variable est toujours définie)market.repo.php— Remplacement de la fonction globalecmp()par une closure avec l'opérateur spaceship<=>install/backup.php— Suppression duisset()redondant aprèstrim()jeedom.config.php— Suppression du genericTypeTHERMOSTAT_HUMIDITYnon utiliséphpstan.neon— Ajout du bootstrap elfinder pour l'analyse statiqueSuggested changelog entry
Améliorations de robustesse du code (guards, boucles, retours de méthodes)
Related issues/external references
Découpage de #3122
Types of changes
PR checklist