xenforo-ltd / xf-cs-fixer
A PHP Coding Standards Fixer configuration for XenForo
Installs: 1 604
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 6
Forks: 0
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- friendsofphp/php-cs-fixer: ^3.0
Requires (Dev)
- phpstan/phpstan: ^1.0
- phpstan/phpstan-strict-rules: ^1.0
README
A PHP Coding Standards Fixer configuration for XenForo.
This library provides a configuration helper and a handful of additional rules which supplement the built-in PER-CS rule set to automatically format code according to the XenForo code style.
Installing
To use our configuration or rules, install them with Composer:
composer require --dev xenforo-ltd/xf-cs-fixer
Usage
Create a .php-cs-fixer.dist.php
configuration file in your project directory:
<?php declare(strict_types=1); use PhpCsFixer\Finder; use XFCsFixer\ConfigHelper; $finder = Finder::create() ->in(__DIR__) ->ignoreVCSIgnored(true) ->notPath([ // you may set paths or path patterns to exclude here ]); $helper = new ConfigHelper($finder); // you may customize the rules or configuration further here return $helper->getConfig();
For more information, consult the PHP Coding Standards Fixer documentation.