liveintent / php-cs-fixer
LiveIntent code style rules for php-cs-fixer
Installs: 11 664
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- php: ^8.0|^8.1
- friendsofphp/php-cs-fixer: ^3.6
- laravel/framework: ^9.0
- spatie/laravel-package-tools: ^1.11
Requires (Dev)
- nunomaduro/collision: ^6.1
- phpunit/phpunit: ^9.5
- vimeo/psalm: ^4.20
README
This package contains a code style linter for LiveIntent PHP projects. Under the hood it simply wraps php-cs-fixer, configures it with our agreed rule set, and adds some of our own custom rules.
Installation
You can install the package via composer:
composer require liveintent/php-cs-fixer
Usage
Create a .php-cs-fixer.dist.php
file at the root of your project with the following contents:
<?php $finder = Symfony\Component\Finder\Finder::create() ->in([ __DIR__ . '/src', __DIR__ . '/tests', ]) ->name('*.php') ->ignoreDotFiles(true) ->ignoreVCS(true); return (new LiveIntent\PhpCsFixer\Config())->setFinder($finder);
Adjust the folders to analyze as needed.
Development
Clone this repository and install dependencies via:
composer install
Testing
You can run the tests via:
composer test
Linting
The installed linter will auto-format your code.
You can run it via:
composer lint