nicwortel/coding-standard

My ruleset for PHP CodeSniffer

Installs: 5 127

Dependents: 3

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

v2.3.0 2024-01-11 15:46 UTC

This package is auto-updated.

Last update: 2024-11-11 17:28:41 UTC


README

Build status License Packagist version PHP version from Packagist

This is my ruleset for PHP CodeSniffer. It's based on the PSR-12 Extended Coding Style, enhanced with sniffs from the Slevomat Coding Standard.

Installation

composer require --dev squizlabs/php_codesniffer nicwortel/coding-standard

Usage

Create a phpcs.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
    <arg name="basepath" value="."/>
    <arg name="cache" value=".phpcs-cache"/>
    <arg name="colors"/>
    <arg name="extensions" value="php"/>

    <!-- Show progress and sniff names -->
    <arg value="ps" />

    <file>src/</file>

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

Then you can run vendor/bin/phpcs.