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.
You can install the package via composer:
composer require liveintent/php-cs-fixer
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.
Clone this repository and install dependencies via:
composer install
You can run the tests via:
composer test
The installed linter will auto-format your code.
You can run it via:
composer lint