Skip to content

Initialisation des variables potentiellement non définies (PHPStan lvl 1)#3257

Open
kwizer15 wants to merge 1 commit intojeedom:developfrom
kwizer15:fix/phpstan-undefined-vars
Open

Initialisation des variables potentiellement non définies (PHPStan lvl 1)#3257
kwizer15 wants to merge 1 commit intojeedom:developfrom
kwizer15:fix/phpstan-undefined-vars

Conversation

@kwizer15
Copy link
Copy Markdown
Contributor

Description

Ajout de l'initialisation des variables qui peuvent être utilisées avant d'être définies, détectées par PHPStan au niveau 1.

Chaque modification est une simple initialisation de variable ($var = null, $var = [], etc.) avant un bloc conditionnel ou une boucle qui l'assigne. Aucun changement de comportement.

Fichiers concernés :

  • core/ajax/eqLogic.ajax.php$eqLogic
  • core/ajax/scenario.ajax.php$converts
  • core/ajax/user.ajax.php$configs (appel config::byKeys manquant)
  • core/api/jeeApi.php$object, $cmd, $scenario, $update (x2)
  • core/class/history.class.php$goupingType
  • core/class/interactQuery.class.php$closest, $objects, $cmd
  • core/class/jeeObject.class.php$events
  • core/class/update.class.php$url
  • core/class/utils.class.php$return
  • core/class/widgets.class.php$_needRefreshWidget
  • core/php/utils.inc.php$return dans pageTitle()
  • desktop/modal/planHeader.configure.php$link

Suggested changelog entry

Initialisation de variables non définies détectées par PHPStan

Related issues/external references

Découpage de #3122

Types of changes

  • Bug fix (non-breaking change which fixes)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the Contribution guidelines for this project.
  • I grant the project the right to include and distribute the code under the GNU.
  • I have added tests to cover my changes.
  • I have verified that the code complies with the projects coding standards.
  • [Required for new sniffs] I have added MD documentation for the sniff.

@Mips2648 Mips2648 self-assigned this Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants