An open API service indexing awesome lists of open source software.

https://github.com/sunray/coding-standard

The Sunray development coding standard
https://github.com/sunray/coding-standard

coding-standards coding-style eslint javascript php php-codesniffer php7 prettier

Last synced: 3 months ago
JSON representation

The Sunray development coding standard

Awesome Lists containing this project

README

        

# Sunray Coding Standard

[![Downloads](https://img.shields.io/packagist/dt/sunray/coding-standard.svg?style=flat-square)](https://packagist.org/packages/sunray/coding-standard)
[![License](https://img.shields.io/github/license/sunray/coding-standard.svg?style=flat-square)](https://github.com/sunray/coding-standard/blob/master/LICENSE)

A coding standard to use for common PHP and JavaScript modules.

The main objectives of this standard are outlined in the
[Sunray Coding Philosophy](coding-philosophy.md) which
aims to create an efficient development workflow resulting from readable, debuggable, and
maintainable code. The general principles are:
* [Consistency](coding-philosophy.md#consistency)
* [Strict and Predictable Code](coding-philosophy.md#strict-and-predictable-code)
* [Minimize The Impact of Change](coding-philosophy.md#minimize-the-impact-of-change)
* [Optimize for Readability](coding-philosophy.md#optimize-for-readability)
* [Optimize for Code Completion](coding-philosophy.md#optimize-for-code-completion)

## PHP

> **The PHP specific coding standards are outlined in a
> [separate document](coding-standard-php.md).**

#### 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:
```xml
















```
2. From your application root execute the following:
```bash
vendor/bin/phpcs
```

## JavaScript