Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oyova/php-cs-fixer
A wrapper for PHP CS Fixer.
https://github.com/oyova/php-cs-fixer
Last synced: 6 days ago
JSON representation
A wrapper for PHP CS Fixer.
- Host: GitHub
- URL: https://github.com/oyova/php-cs-fixer
- Owner: oyova
- License: mit
- Created: 2022-11-30T00:53:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-30T22:37:57.000Z (about 1 year ago)
- Last Synced: 2024-10-08T03:28:54.265Z (about 1 month ago)
- Language: PHP
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Oyova PHP CS Fixer
This package is a wrapper for [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer). PHP CS Fixer is used to automatically fix PHP coding standards issues and this package establishes the preferred Oyova rules and simplifies setup.## Installation
Install the package via Composer:
```
composer require --dev oyova/php-cs-fixer
```## Setup
In the project root, create a file named `.php-cs-fixer.php` with the following code:
```php
in(string|array)
// ->exclude(string|array)
// ->notName(string|array)
->getConfig();
```
For WordPress, use `Oyova\PhpCsFixer\WordPressSetup` instead of `Oyova\PhpCsFixer\Setup`.## Usage
From the project root, run the command `vendor/bin/php-cs-fixer fix` to fix all configured files or `vendor/bin/php-cs-fixer fix path/to/file.php` to fix a specific file or directory. [Create a bash alias](https://linuxize.com/post/how-to-create-bash-aliases) for the command for ease of use (e.g. `alias phpfix='vendor/bin/php-cs-fixer fix'`).