diff --git a/.gitignore b/.gitignore index 7e2bc02..c59823b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /vendor /bin /composer.lock +/.php_cs.cache diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..2300304 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,29 @@ +setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + '@Symfony:risky' => true, + 'array_syntax' => array('syntax' => 'short'), + 'combine_consecutive_unsets' => true, + 'heredoc_to_nowdoc' => true, + 'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'], + 'no_unreachable_default_argument_value' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'ordered_class_elements' => true, + 'ordered_imports' => true, + 'phpdoc_add_missing_param_annotation' => true, + 'phpdoc_order' => true, + 'psr4' => true, + 'strict_param' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->notPath('src/AppBundle/Command/TestCommand.php') + ->exclude('tests/*/Fixtures') + ->exclude('var') + ->in(__DIR__) + ) +; diff --git a/CHANGELOG.md b/CHANGELOG.md index c7b2392..168c0ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * ext/vips 1.0.8 is required. Throw exceptions in methods, which needs vips 8.6. * Add constructor config array to be able to set `vips_cache_set_max_mem` et al. * Fix paste method to work with future php-vips versions + * Added php-cs-fixer ### 0.0.4 (2017-11-27) diff --git a/composer.json b/composer.json index a075291..d60b424 100644 --- a/composer.json +++ b/composer.json @@ -49,5 +49,8 @@ "imagine-*.phar", "composer.phar" ] + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.8" } }