The command below is the command used to check the coding standard.
$ phpcs src/
Note:
By default, the command phpcs automatically read the configuration file that has been named phpcs.xml. So, to run the above command phpcs, it is not need to specify the configuration file.
3. Quality assurance
🔧 Environments:
Platform version: OpenCart 1.5.6.4
Omise plugin version: Omise-OpenCart 1.4
PHP versions: 5.3.29 and 5.5.9
✏️ Details:
Test everything.
Test case 1: Create success charge by credit card
Test case 2: Create fail charge by credit card
Test case 3: Create success charge by internet banking
Test case 4: Create fail charge by internet banking
4. Impact of the change
The PHP files under directories, src/admin and src/catalog are reformatted by using ruleset from the OpenCart Coding standards.
5. Priority of change
High, or conflict.
6. Additional notes
The reason for adding 2 files, configuration file (phpcs.xml) and ruleset file (.phpcs/OpenCart/ruleset.xml) is to separate the rule out from the configuration. So, the ruleset file will contained only rules for checking the PHP source code.
The reason for adding additional 2 rules to the ruleset file is from the OpenCart Coding standards page, it has specified a new line standard but in the OpenCart ruleset file, it has not specify this rule.
So, it need to add more rules to make the ruleset file conformed with the rule on the OpenCart Coding standards page.
1. Objective
This PR reformats all PHP files according to OpenCart provided ruleset.xml.
2. Description of change
phpcs.xml
.phpcs/OpenCart/ruleset.xml
src/admin
andsrc/catalog
, by using the tool PHP Code Beautifier and Fixer (phpcbf)The commands below are the commands used to automatically format the PHP files.
The command below is the command used to check the coding standard.
Note: By default, the command
phpcs
automatically read the configuration file that has been namedphpcs.xml
. So, to run the above commandphpcs
, it is not need to specify the configuration file.3. Quality assurance
🔧 Environments:
✏️ Details:
Test everything.
Test case 1: Create success charge by credit card Test case 2: Create fail charge by credit card Test case 3: Create success charge by internet banking Test case 4: Create fail charge by internet banking
4. Impact of the change
The PHP files under directories,
src/admin
andsrc/catalog
are reformatted by using ruleset from the OpenCart Coding standards.5. Priority of change
High, or conflict.
6. Additional notes
The reason for adding 2 files, configuration file (
phpcs.xml
) and ruleset file (.phpcs/OpenCart/ruleset.xml
) is to separate the rule out from the configuration. So, the ruleset file will contained only rules for checking the PHP source code.The reason for adding additional 2 rules to the ruleset file is from the OpenCart Coding standards page, it has specified a new line standard but in the OpenCart ruleset file, it has not specify this rule. So, it need to add more rules to make the ruleset file conformed with the rule on the OpenCart Coding standards page.
References: