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

[Question] about project best practices #22

Open
falsefabien opened this issue Mar 31, 2022 · 0 comments
Open

[Question] about project best practices #22

falsefabien opened this issue Mar 31, 2022 · 0 comments

Comments

@falsefabien
Copy link

Hello @slashfan 👋, I really appreciate your work, it's very qualitative, it allowed me to deepen my knowledge with Symfony and especially learn how to build a solid API.

I noted some questions about the good practices you used during the development of this project. I would be really grateful if you can enlighten me on some points, it will certainly be very useful for the followers of this project even for those how wanna contribute.

  1. Why you prefer not to using the AbstractController proposed by the framework, instead of injecting all the services one by one under your controller consutruct. I feel that the answer is related to a good practice but I do not really see why!

  2. What's the point of adding the final key, on services, controllers, subscribers ?

  3. Does there is a convention used for renaming your controllers, for example often you use this format <Get|Create|Delete..><Entity>Controller.php like GetArticleController.php and sometimes you just use<some string>Controller.php like SecurityController.php

  4. I wonder why you prefer having only one function per controller and not more. Is there a use behind this design !

  5. Is there a rule or an RFC for renaming paths when defining routes. For example if you have a route responsible for exporting any article, do I should call it /api/article/1.pdf or /api/article/export.pdf ?

  6. Is there a rule for renaming services, it is better to suffix them by Service or Handler or nothing. What about having one function per a service like you did inside the controllers ?

  7. Instead of using the form component via $form->submit() + form types , why you didn't use the Denormelizers to retrieve your data and populate it in your entity for POST, PUT and PATCH methods and then you collect validations errors like it's mentioned here ?

  8. What is the difference between EventListener and EventSubscriber, what is the most recommended for use and why you did put JWTAuthenticationSubscriber.php in EventSubscriber instead of putting it in EventLisetner ?

  9. I see Rector, PHPstan or PHPslam, or PHPmd ? what is the difference are they all a statics analyzers tools !

I look forward to your response. Thank you so mush 🙏. Cheers!

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

No branches or pull requests

1 participant