sun-asterisk/coding-standard

Sun* R&D PHP coding standard

Installs: 36 071

Dependents: 2

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 3

Open Issues: 0

Type:phpcodesniffer-standard

v0.2.5 2022-07-22 03:14 UTC

This package is auto-updated.

Last update: 2024-12-22 08:10:32 UTC


README

Latest Stable Version

Sun* coding standard for PHP_CodeSniffer.

Installation

Using composer

composer require --dev sun-asterisk/coding-standard

Usage

Add the SunAsterisk standard to your project's phpcs.xml:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="YourProject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <rule ref="SunAsterisk"/>
</ruleset>

Or use it on the command line

vendor/bin/phpcs --standard=SunAsterisk <file or directory to check>

Laravel

The SunAsteriskLaravel standard is extended for Laravel projects. You can use it as below:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="YourProject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <file>app</file>
    <file>config</file>
    <file>database</file>
    <file>resources</file>
    <file>routes</file>
    <file>tests</file>

    <exclude-pattern>vendor/</exclude-pattern>

    <rule ref="SunAsteriskLaravel"/>
</ruleset>

Refer to the phpcs documents for more detailed usage. Also refer to slevomat/coding-standard for details on some sniffs.