Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/signpostmarv/php-cs-fixer-config
PHP-CS-Fixer Config
https://github.com/signpostmarv/php-cs-fixer-config
Last synced: 5 days ago
JSON representation
PHP-CS-Fixer Config
- Host: GitHub
- URL: https://github.com/signpostmarv/php-cs-fixer-config
- Owner: SignpostMarv
- License: isc
- Created: 2017-05-06T16:30:20.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-01-26T10:54:18.000Z (10 months ago)
- Last Synced: 2024-08-11T15:04:45.093Z (3 months ago)
- Language: PHP
- Size: 356 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SignpostMarv's PHP-CS-Fixer config
[![Build Status](https://travis-ci.org/SignpostMarv/PHP-CS-Fixer-Config.svg?branch=master)](https://travis-ci.org/SignpostMarv/PHP-CS-Fixer-Config)
[![Psalm Type Coverage](https://shepherd.dev/github/SignpostMarv/PHP-CS-Fixer-Config/coverage.svg)](https://shepherd.dev/github/SignpostMarv/PHP-CS-Fixer-Config)There's two different versions, one for general use & one for use on projects that use static analysis.
## Installation & Usage
1. `composer require --dev signpostmarv/php-cs-fixer-config`
1. create your `.php_cs` or `.php_cs.dist` file and enter the corresponding
code for the config you wish to use### General Use
```php
return \SignpostMarv\CS\Config::createWithPaths(...[
__FILE__,
(__DIR__ . '/src/'),
(__DIR__ . '/tests/'),
])
```#### Use without PHP 7.1 Nullable return types
```php
return \SignpostMarv\CS\ConfigUsedWithoutNullableReturn::createWithPaths(...[
__FILE__,
(__DIR__ . '/src/'),
(__DIR__ . '/tests/'),
])
```### With Static Analysis
```php
return \SignpostMarv\CS\ConfigUsedWithStaticAnalysis::createWithPaths(...[
__FILE__,
(__DIR__ . '/src/'),
(__DIR__ . '/tests/'),
])
```#### Use without PHP 7.1 Nullable return types
```php
return \SignpostMarv\CS\ConfigUsedWithStaticAnalysisWithoutNullableReturn::createWithPaths(...[
__FILE__,
(__DIR__ . '/src/'),
(__DIR__ . '/tests/'),
])
```### Customising Rules
1. Extend `SignpostMarv\CS\Config`
1. Either
* override the `SignpostMarv\CS\Config::DEFAULT_RULES` array const
* override the `SignpostMarv\CS\Config::RuntimeResolveRules()` static
method as in [ConfigUsedWithStaticAnalysis](https://github.com/SignpostMarv/PHP-CS-Fixer-Config/blob/master/src/ConfigUsedWithStaticAnalysis.php)