2017 © Pedro Peláez
 

library php-cs

PHP Coding style configuration for reBuy projects

image

rebuy/php-cs

PHP Coding style configuration for reBuy projects

  • Tuesday, January 17, 2017
  • by Spea
  • Repository
  • 22 Watchers
  • 0 Stars
  • 10,317 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

php-cs

The file .php_cs.dist contains all rules which apply to the coding standards for rebuy. You can find the description of these rules in the PHP-CS-Fixer repository., (*1)

Examples

Travis code style check

vendor/bin/php-cs-fixer fix --config=vendor/rebuy/php-cs/.php_cs.dist -v --dry-run --using-cache=no `git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE`

Note: If you define the path in your own .php_cs.dist file, you might want use --path-mode intersection., (*2)

Fixing code styles

vendor/bin/php-cs-fixer fix --config=vendor/rebuy/php-cs/.php_cs.dist yourDirectory/`

Fixing code styles from $yourBranch to master

vendor/bin/php-cs-fixer fix --config=.php_cs.dist `git diff --name-only --diff-filter=ACMRTUXB master`

Overwriting rules

There might be some scenarios where you have to adjust the rules defined here, in this case you can include the base file and extend it to your needs:, (*3)

<?php

$config = include 'vendor/rebuy/php-cs/.php_cs.dist';

$currentRules = $config->getRules();
$newRules = [
    'phpdoc_no_empty_return' => false,
];

$config->setRules(array_merge($currentRules, $newRules));

The Versions

17/01 2017

dev-master

9999999-dev

PHP Coding style configuration for reBuy projects

  Sources   Download

MIT

The Requires

 

17/01 2017

v1.0.0

1.0.0.0

PHP Coding style configuration for reBuy projects

  Sources   Download

MIT

The Requires