serendipity_hq/phpcs-config

Custom configuration for PHP CS Fixer used by Serendipity HQ.

1.2.5 2023-10-07 16:02 UTC

This package is auto-updated.

Last update: 2024-04-07 17:22:00 UTC


README

687474703a2f2f7777772e736572656e64697069747968712e636f6d2f6173736574732f6f70656e2d736f757263652d70726f6a656374732f4c6f676f2d536572656e64697069747948512d49636f6e2d546578742d507572706c652e706e67

Serendipity HQ PHP CS Fixer Configuration

A predefined configuration used in Serendipity HQ's projects.

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736572656e6469706974795f68712f70687063732d636f6e6669672e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736572656e6469706974795f68712f70687063732d636f6e6669673f636f6c6f723d253233383839324246267374796c653d666c61742d737175617265266c6f676f3d706870

Current Status

Phan PHPStan PSalm PHPUnit Composer PHP CS Fixer

Do you like this library?
LEAVE A ★

or run
composer global require symfony/thanks && composer thanks
to say thank you to all libraries you use in your current project, this included!

Install monolog-html-line-formatter via Composer

$ composer require serendipity_hq/phpcs-config

This library follows the http://semver.org/ versioning conventions.

How to use Serendipity HQ PHP CS Fixer Config

<?php

// WARNING: This variable is fundamental as the rules array sets the `header_comment` rule and expects the variable exists.
$header = <<<EOF
This file is part of the Serendipity HQ PHP CS Fixer Config.

Copyright (c) Adamo Aerendir Crespi <aerendir@serendipityhq.com>.

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;

$rules = include \SerendipityHQ\Integration\PhpCsFixer\SerendipityHQ::SHQ_LIBRARY;

$finder = PhpCsFixer\Finder::create()
->in([
    __DIR__.'/src',
    __DIR__.'/tests'
]);

$config = new PhpCsFixer\Config();
return $config
    ->setFinder($finder)
    ->setUsingCache(true)
    ->setCacheFile(__DIR__.'/var/cache/.php_cs.cache')
    ->setRiskyAllowed(true)
    ->setRules($rules);

To change the rules or their configuration on a per-project basis, simply edit the $rule variable and then pass it to the Config::setRues() method.

Do you like this library?
LEAVE A ★

or run
composer global require symfony/thanks && composer thanks
to say thank you to all libraries you use in your current project, this included!