Skip to content
This repository was archived by the owner on Apr 26, 2022. It is now read-only.

Coding Standards

Burak Çakırel edited this page Jan 21, 2016 · 2 revisions

When contributing code to Arastta, you must follow its coding standards. Here is the golden rule: Imitate the existing Arastta code.

Arastta tries to adhere the coding standards defined in the PSR-1 and PSR-2 documents. Except the following ones due to not brake OC extensions compatibility:

Also, here is the file for PhpStorm: Arastta.xml Copy the file to:

  • Mac ~/Library/Preferences/WebIdeXX/config/codestyles/Arastta.xml
  • Windows <User home>\.WebIdeXX\config\codestyles\Arastta.xml
  • Linux ~/.WebIdeXX/config/codestyles/Arastta.xml

Additionally, here is the other coding standards for Arastta:


### Indentation All files(PHP, TPL, JS, CSS, JSON, SQL) must be indented using the 4 space tabs. TAB character are not supported.
### File naming All files should be in lower case and words separated by an underscore.
### PHP Function (helpers) naming Helper function names should be lower case and an underscore used to separate words.
### PHP variable naming PHP variables should be lower case and an underscore used to separate words (snake_case).
Correct:
$var = 123;
$new_var = 12345;
Incorrect:
$Var = 123;
$newVar = 12345;

### User defined constants User defined constants are set as upper case.
Correct:
define('MY_VAR', 'My constant string value');
Incorrect:
define('my_var', 'My constant string value');

### PHP constants These types of constant (true,false,null) are set as lower case
Correct:
$my_var = true;
Incorrect:
$my_var = TRUE;

### HTML / CSS rules Class names and id's should be hyphenated and not use an underscore
Correct:
class="my-class"
Incorrect:
class="my_class"

Clone this wiki locally