2017 © Pedro Peláez
 

library lib-php-cs-fixer-config

PHP CS Fixer config for Paysera conventions

image

paysera/lib-php-cs-fixer-config

PHP CS Fixer config for Paysera conventions

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 23 Versions
  • 66 % Grown

The README.md

lib-php-cs-fixer-config

Library helps to fix PHP code to conform Paysera PHP style guide., (*1)

Installation

Prerequisite

  • Add Paysera\\PhpCsFixerConfig\\Composer\\PhpCsFixerConfigProvider::copyPhpCs script to post-install-cmd and post-update-cmd or other scripts - just make sure this script is executed on composer install.

Install and check

  • composer require --dev paysera/lib-php-cs-fixer-config.
  • Make sure php-cs-fixer.php file is in project directory.

No need to install php-cs-fixer itself as this library comes with binary version of the fixer. This avoids requiring its dependencies inside your project, which could clash with existing ones., (*2)

To avoid duplication with php-cs-fixer library, it's named paysera-php-cs-fixer., (*3)

php-cs-fixer.php files
  • php-cs-fixer.php - all Paysera recommended fixers.
  • php-cs-fixer-risky.php - all risky fixers except recommendations (comment warnings).
  • php-cs-fixer-safe.php - all non risky fixers.

Migration mode

For new projects you can just use all the rules as usual., (*4)

For existing projects we recommend turning on the migration mode: 1. Add call to enableMigrationMode([]) to PayseraConventionsConfig instance in your php-cs-fixer.php file. 2. Run {your-bin-dir}/php-cs-fixer - it will give error with initial rule configuration to pass into that method. Just copy-and-paste it to your php-cs-fixer.php file. 3. Enable one of the rules, apply fixes in the project, review and test them. 4. Repeat with each new rule., (*5)

This allows to control which rules are enabled in the project thus letting manually tune the fixes already applied in the repository and forced for the new code. Also, your commits will be more focused as each of them will include only changes from a single fixer., (*6)

All rules are to be configured to allow easily spotting new rules in case they would be added (or removed) into the core., (*7)

Running fixer with tests

For comments or suggestions for developers you should use default php-cs-fixer.php file with all the rules., (*8)

For automatic checks there might be some false-positives so php-cs-fixer-risky.php should be used in such cases., (*9)

You can look at .travis.yml file in this repository for integration with travis on each pull request of your repository (this will run the checks only for changed files)., (*10)

Usage

Run in project directory by command: {your-bin-dir}/php-cs-fixer fix /path/to/code --verbose --dry-run --diff, (*11)

Use --config=php-cs-fixer.php flag for custom configuration., (*12)

If /path/to/code is not defined php-cs-fixer will run files from default src directory excluding Test folders., (*13)

--verbose - show the applied rules. When using the txt format it will also display progress notifications., (*14)

A combination of --dry-run and --diff will display a summary of proposed fixes, leaving your files unchanged., (*15)

--format option for the output format. Supported formats are txt (default one), json, xml and junit., (*16)

More information: PHP CS Fixer, (*17)

The Versions

04/07 2018

dev-master

9999999-dev

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

04/07 2018

1.7.5

1.7.5.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

04/07 2018

1.7.6

1.7.6.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

18/06 2018

1.7.4

1.7.4.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

06/06 2018

1.7.3

1.7.3.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

28/05 2018

1.7.2

1.7.2.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

22/03 2018

1.7.1

1.7.1.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

21/03 2018

1.7.0

1.7.0.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

13/03 2018

1.6.1

1.6.1.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

26/02 2018

1.6.0

1.6.0.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

17/02 2018

1.5.0

1.5.0.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

12/02 2018

1.4.4

1.4.4.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

12/02 2018

1.4.3

1.4.3.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

09/02 2018

1.4.2

1.4.2.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

09/02 2018

1.4.1

1.4.1.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

07/02 2018

1.4.0

1.4.0.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

01/02 2018

1.3.0

1.3.0.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

01/02 2018

1.2.0

1.2.0.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

30/01 2018

1.1.2

1.1.2.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

29/01 2018

1.1.1

1.1.1.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

22/01 2018

1.1.0

1.1.0.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

21/09 2017

1.0.1

1.0.1.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires

08/08 2017

1.0.0

1.0.0.0

PHP CS Fixer config for Paysera conventions

  Sources   Download

The Requires

 

The Development Requires