2017 © Pedro Peláez
 

library coding-standard

The Sunray development coding standard

image

sunray/coding-standard

The Sunray development coding standard

  • Wednesday, May 30, 2018
  • by virgofx
  • Repository
  • 3 Watchers
  • 1 Stars
  • 26 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

Sunray Coding Standard

Downloads License, (*1)

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)

PHP

The PHP specific coding standards are outlined in a separate document., (*4)

Requirements

  • PHP 7.1+
  • Composer

Installation

  1. Add "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

Usage

  1. 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>
    
  2. From your application root execute the following: bash vendor/bin/phpcs

JavaScript

The Versions

30/05 2018

dev-master

9999999-dev

The Sunray development coding standard

  Sources   Download

MIT

The Requires