Skip to content

Commit

Permalink
Service class readme
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed May 1, 2021
1 parent 94a57cf commit 94bb030
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions application/models/services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
The newly added service classes are expected to have a higher quality than older code in LimeSurvey. Especially:

* PSR-12 compliant
* Don't use Hungarian notation, but instead proper docblocks and @var annotations
* Don't use Hungarian notation, but instead proper docblocks and @var annotations that can be checked by Psalm
* All methods are expected to be testable with unit-tests, which means that all dependencies should be injected _or_ side-effects isolated in small, mockable methods
* Don't use static methods unless you can prove that they don't need to be mocked. Maybe a separate function outside a class would be better?
* Eventually, Psalm will be used to validate that docblocks are correct
* MessDetector might be used to enforce maximum class and method length
* A [dependency injection container](https://www.yiiframework.com/doc/guide/2.0/en/concept-di-container) will be used to coordinate dependencies in the future

Expand Down

0 comments on commit 94bb030

Please sign in to comment.