Skip to content

fix: Suppression des arguments superflus dans les appels de méthodes (PHPStan lvl 1)#3258

Merged
Mips2648 merged 1 commit intojeedom:developfrom
kwizer15:fix/phpstan-extra-args
Apr 17, 2026
Merged

fix: Suppression des arguments superflus dans les appels de méthodes (PHPStan lvl 1)#3258
Mips2648 merged 1 commit intojeedom:developfrom
kwizer15:fix/phpstan-extra-args

Conversation

@kwizer15
Copy link
Copy Markdown
Contributor

Description

Suppression des arguments passés en trop lors d'appels de méthodes. Ces paramètres n'existent pas dans la signature des fonctions appelées et sont donc ignorés silencieusement par PHP. Aucun changement de comportement.

Exemples :

  • cache::set() appelé avec 4 args au lieu de 3
  • history::getHistoryFromCalcul() avec un 6e argument inexistant
  • interactQuery::byInteractDefId() avec un 2e argument inexistant
  • listener::all(), queue::all(), jeeObject::getUISelectList() avec des arguments en trop
  • jeedom::update() avec un 2e argument inexistant
  • repo_market::backup_restore() avec un 2e argument inexistant
  • update::getLastAvailableVersion() avec un argument inexistant
  • ajax::success($return) remplacé par ajax::success() quand $return n'est pas défini
  • user::removeBanIp() : retour void utilisé comme argument de ajax::success()

Suggested changelog entry

Nettoyage des arguments superflus dans les appels de méthodes (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.

Comment thread core/ajax/user.ajax.php
ajax::success(user::removeBanIp());
user::removeBanIp();
ajax::success();
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, this was not an issue as such, both will work same way I think but it is more explicit and clear now

@Mips2648 Mips2648 requested review from Salvialf and zoic21 April 17, 2026 06:46
@Mips2648 Mips2648 merged commit 1794393 into jeedom:develop Apr 17, 2026
9 checks passed
@Mips2648 Mips2648 changed the title Suppression des arguments superflus dans les appels de méthodes (PHPStan lvl 1) fix: Suppression des arguments superflus dans les appels de méthodes (PHPStan lvl 1) Apr 18, 2026
@Mips2648 Mips2648 added the changelog-fix Use to generate release notes / changelog To be apply on PR label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-fix Use to generate release notes / changelog To be apply on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants