liveintent/php-cs-fixer

There is no license information available for the latest version (v3.0.0) of this package.

LiveIntent code style rules for php-cs-fixer

v3.0.0 2022-02-15 12:29 UTC

This package is auto-updated.

Last update: 2024-05-13 18:58:11 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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