Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests : ajout de PHPStan #662

Merged
merged 13 commits into from
Jan 4, 2023
Merged

Tests : ajout de PHPStan #662

merged 13 commits into from
Jan 4, 2023

Conversation

raphodn
Copy link
Member

@raphodn raphodn commented Nov 27, 2022

Voir l'issue #699
Suite de #661

Pour lancer la commande en local (après avoir fait un composer install)

vendor/bin/phpstan analyse src

@raphodn raphodn changed the base branch from master to raphodn/test-ci-github-actions November 27, 2022 11:51
Base automatically changed from raphodn/test-ci-github-actions to master November 27, 2022 20:15
@raphodn raphodn force-pushed the raphodn/test-add-phpstan branch from 858c0bd to b407950 Compare December 22, 2022 20:55
@raphodn raphodn linked an issue Dec 23, 2022 that may be closed by this pull request
2 tasks
@raphodn raphodn force-pushed the raphodn/test-add-phpstan branch 2 times, most recently from 701cf47 to 4e84d2c Compare December 24, 2022 15:01
@raphodn raphodn self-assigned this Jan 3, 2023
@raphodn raphodn force-pushed the raphodn/test-add-phpstan branch from e95e13d to 7ec2aa6 Compare January 3, 2023 17:57
@raphodn raphodn marked this pull request as ready for review January 3, 2023 18:01
@raphodn raphodn requested review from petitalb and symartin January 3, 2023 18:01
@raphodn raphodn linked an issue Jan 3, 2023 that may be closed by this pull request
@raphodn
Copy link
Member Author

raphodn commented Jan 3, 2023

@petitalb @symartin preneur d'une relecture :)

  • il y a pas mal de petites modifs pour résoudre toutes les erreurs remontées par PHPStan (vous pouvez essayer de lancer la commande sur master pour voir ses résultats)
  • il reste une dernière erreur que je n'arrive pas à résoudre 🤔
    Screenshot from 2023-01-03 19-09-29

@raphodn raphodn removed a link to an issue Jan 3, 2023
2 tasks
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

supprimer ce code mort plutot ?

Copy link
Member Author

Choose a reason for hiding this comment

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

j'étais allé un peu vite en besogne je trouve, j'ai modifié pour éviter de supprimer ce bout de code : a9878dc

*
* @return \DateTime
*/
public function getMinDateOfLastRegistration()
Copy link
Member Author

Choose a reason for hiding this comment

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

@petitalb merci pour le fix. du coup pas possible de récupérer les paramètres dans une Entity ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Il me semble que ce n'est pas possible effectivement. Faut passer par un service.

Note, ce code n'était de toute façon pas utilisé, je l'avais déjà remarqué dans ma PR #698.

@raphodn
Copy link
Member Author

raphodn commented Jan 4, 2023

les tests PHPStan passent 🎉
48 erreurs résolues dans cette PR 💪

@raphodn raphodn merged commit fe1c854 into master Jan 4, 2023
@raphodn raphodn deleted the raphodn/test-add-phpstan branch January 4, 2023 09:10
quot17 pushed a commit to quot17/gestion-compte that referenced this pull request Mar 28, 2023
* Add PHPStan package. run in CI

* Fix errors from Entities & Controllers

* fix errors in BookingController

* remove useless  from EntityService

* remove useless  from CommissionJoinOrLeaveEvent

* ToggleableHandler: handle() should return bool

* fix BeneficiaryService & MembershipService

* fix ShiftService

* fix SwipeCardEvent & TimeLogEventListener

* fix BasePathPicture

* fix Commands

* Remove unused code

* homogenise form error display

Co-authored-by: Albin PETIT <[email protected]>
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.

Tests : ajouter PHPStan
2 participants