Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 1.58 KB

CODING GUIDELINE.md

File metadata and controls

13 lines (11 loc) · 1.58 KB

Coding Guideline

  1. Code style must follow PSR-1, PSR-2 and PSR-12.
  2. a file suffix should be sufficient to know what it does for instance an Exception class should have Exception as it suffix, a service class should have Service as it suffix, a Command class should have Command as it suffix.
  3. All Service classes must be well tested with tests for all their public methods defined in the tests/Unit directory.
  4. Command classes must be well tested with tests placed in the tests/Feature directory.
  5. app/Services directory is where Service classes are placed. Ideally complex tasks are not expected to be completely run in the console classes. Service classes are created so the console classes primary handle input and output.
  6. Doc blocks should only be used when they are required to give better context of the method or class. We believe that using clear and concise class and variable names with proper arguments and return type declaration should suffice. If a method returns nothing, then it return type must be declared as void.
  7. api endpoints in the Client class are defined as class properties while methods that fetch resources from the api should have the get prefix. Such method should also be clear on what resource it is fetching.
  8. Our coding guideline is also inspired by spatie coding guideline. You should check it out.