2017 © Pedro Peláez
 

library php-cs-fixer-config

PHP CS Fixer config for M6Web components

image

m6web/php-cs-fixer-config

PHP CS Fixer config for M6Web components

  • Thursday, July 12, 2018
  • by M6Web
  • Repository
  • 21 Watchers
  • 3 Stars
  • 13,121 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 11 Versions
  • 23 % Grown

The README.md

php-cs-fixer-config

PHP CS Fixer config for M6Web components., (*1)

Installation

Run, (*2)

$ composer require --dev m6web/php-cs-fixer-config

Usage

Configuration

Create a configuration file .php-cs-fixer.dist.php in the root of your project:, (*3)

<?php

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

$config = new M6Web\CS\Config\BedrockStreaming();
$config->setFinder($finder);

return $config;

Custom configuration

You may extend these rules and apply your own extra rules., (*4)

Create a configuration file .php-cs-fixer.dist.php in the root of your project:, (*5)

<?php

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

$config = new class() extends PhpCsFixer\Config {
    public function __construct()
    {
        parent::__construct('customized Bedrock Streaming');
        $this->setRiskyAllowed(true);
    }

    public function getRules(): array
    {
        $rules = (new M6Web\CS\Config\BedrockStreaming())->getRules();

        // perform updates on the rules array here

        return $rules;
    }
};

$config->setFinder($finder);

return $config;

Git

Add .php-cs-fixer.cache (this is the cache file created by php-cs-fixer) to .gitignore:, (*6)

vendor/
.php-cs-fixer.cache

Makefile

Create a Makefile with the targets below:, (*7)

# Coding Style

cs:
    ./bin/php-cs-fixer fix --dry-run --stop-on-violation --diff

cs-fix:
    ./bin/php-cs-fixer fix

cs-ci:
    ./bin/php-cs-fixer fix --dry-run --using-cache=no --verbose

Fixing issues

Manually

If you need to check issues locally, just run, (*8)

$ make cs

If you need to fix issues locally, just run, (*9)

$ make cs-fix

In your Continuous Integration, run, (*10)

$ make cs-ci

Credits

Developed by Bedrock Streaming, inspired by refinery29/php-cs-fixer-config., (*11)

License

This project is licensed under the MIT license., (*12)

The Versions

12/07 2018

dev-master

9999999-dev

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

12/07 2018

v1.0.3

1.0.3.0

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

12/07 2018

dev-feature/update-php-cs-fixer

dev-feature/update-php-cs-fixer

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

06/11 2017

v1.0.2

1.0.2.0

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

06/11 2017

v1.0.1

1.0.1.0

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

12/09 2017

v0.5.0

0.5.0.0

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

12/09 2017

v1.0.0

1.0.0.0

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

21/08 2017

v0.4.0

0.4.0.0

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

27/07 2017

v0.3.0

0.3.0.0

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

05/07 2017

v0.2.0

0.2.0.0

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle

24/05 2017

v0.1.0

0.1.0.0

PHP CS Fixer config for M6Web components

  Sources   Download

MIT

The Requires

 

cs codingstyle