dev-master
9999999-devThe Sunray development coding standard
MIT
The Requires
Wallogit.com
2017 © Pedro Peláez
The Sunray development coding standard
A coding standard to use for common PHP and JavaScript modules., (*2)
The main objectives of this standard are outlined in the Sunray Coding Philosophy which aims to create an efficient development workflow resulting from readable, debuggable, and maintainable code. The general principles are: * Consistency * Strict and Predictable Code * Minimize The Impact of Change * Optimize for Readability * Optimize for Code Completion, (*3)
The PHP specific coding standards are outlined in a separate document., (*4)
"sunray/coding-standard": "dev-master" to the require-dev block in your application's
composer.json as follows:
json
{
"require-dev": {
"sunray/coding-standard": "dev-master"
}
}
or automatically:
bash
composer require --dev sunray/coding-standard:dev-master
Create a phpcs.xml file in the root of your application as follows:, (*5)
<!DOCTYPE xml>
<ruleset name="ProjectName">
<!-- Configure Project Paths -->
<!-- PHPCS Settings -->
<arg value="p" />
<arg value="s" />
<arg name="basepath" value="." />
<arg name="colors" />
<arg name="cache" />
<arg name="extensions" value="php" />
<arg name="encoding" value="utf-8"/>
<arg name="report-width" value="80" />
<!-- Include the Sunray coding standard -->
<rule ref="vendor/sunray/coding-standard/ruleset.xml" />
</ruleset>
bash
vendor/bin/phpcs
The Sunray development coding standard
MIT