Actions

Talk

Developer Area/Coding guidelines: Difference between revisions

From Mahara Wiki

No edit summary
(declare as added to page)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:


'''Functions, Classes'''
'''Functions, Classes'''
* Make sure function name starts from letter (no _ before function names).
* Make sure function name starts from letter (no _ before function names, private should be declared as private, php4 time is gone :).
* Single whitespace between functions and between function and code
* Single empty line between functions and between function and code
* Double whitespace between classes
* Double empty line between classes


'''Variables'''
'''Variables'''
Line 22: Line 22:
not
not
  case: a = 25; b = 100; break;
  case: a = 25; b = 100; break;
''All above added to page 06/09/13''
------------------------

Latest revision as of 22:09, 6 September 2013

What needs to be added

Functions, Classes

  • Make sure function name starts from letter (no _ before function names, private should be declared as private, php4 time is gone :).
  • Single empty line between functions and between function and code
  • Double empty line between classes

Variables

  • No hardcoded binary (security reasons)
  • No hardcoded serialised data (security reasons)

general

  • No closing php tag
  • No whitespaces at the end is required (currently it is just recommend)

Control statements

  • "case" multiline syntax:
case:
   a = 25;
   b = 100;
   break;

not

case: a = 25; b = 100; break;

All above added to page 06/09/13