vix/phpcs-sniffs

Custom PHP_CodeSniffer ruleset for strict development standards

Maintainers

Package info

github.com/vix-4800/phpcs-sniffs

Type:phpcodesniffer-standard

pkg:composer/vix/phpcs-sniffs

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0


README

PHPStan Tests PHP Version License: MIT

A comprehensive set of strict PHP_CodeSniffer rules for general PHP, Laravel, and Yii2 projects to maintain high code quality standards in your projects.

Installation

Requirements

  • PHP 8.4 or higher
  • Composer

Install via Composer

composer require --dev vix/phpcs-sniffs

Usage

Basic Configuration

Create a phpcs.xml file in your project root:

<?xml version="1.0"?>
<ruleset name="MyProject">
    <description>My project coding standard</description>

    <!-- Paths to check -->
    <file>src</file>
    <file>tests</file>

    <!-- Use VixPHPCS rules -->
    <rule ref="VixPHPCS"/>
</ruleset>

Sniffs

The package ships with the VixPHPCS ruleset. Alternatively, individual standalone sniffs can be enabled manually. See docs/SNIFFS.md for the full catalog, examples, and configurable parameters.

Development

Guidelines

  • All new sniffs must have tests
  • Follow the existing code style
  • Update documentation when necessary
  • Ensure all checks pass (composer test and composer static-analysis)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Additional Resources