Coding Standard - CSE327-Project-Group-1/Travel-management-system GitHub Wiki

Coding Standards: (Laravel PHP)

Variable Names −

  1. Use all lower case letters
  2. Use '_' like the word separator.
  3. Global variables should be prepended with a 'g'.
  4. Global constants should be in all caps with '_' separators.
  5. Static variables may be prepended with 's'.

Example- tourist_firstName

Constants Name:

Constants should be in all upper-case with underscores separating words.

Example- define( 'DOING_AJAX', true );

Method Name:

All method names are written in lowerCamelCase. In order to avoid problems with different filesystems, only the characters a-z, A-Z and 0-9 are allowed for method names – don’t use special characters.

Example: myMethod()

Package and Module Names:

Package or module name should in lower case and short. For multiple word variable the should in “lower_case_with_underscores”.

Class Name:

Class names should be descriptive nouns in PascalCase and as short as possible.

Example:

class MyProject ()

Exception Names:

When an exception is thrown, the code following it will not be executed, and PHP will try to find the matching "catch" block. If an exception is not caught, a fatal error will be issued with an "Uncaught Exception" message.

Indentation:

Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting. In PHP, each nested statement (e.g., a statement following a "{" brace) should be indented exactly once more than the previous line's indentation.

we used guiding from https://laravel.com/docs/9.x/routing this page. we have also provided the necessary documents to follow the coding standards.