diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..5285396 --- /dev/null +++ b/.php_cs @@ -0,0 +1,57 @@ +. +EOF; + + +return PhpCsFixer\Config::create() + ->setRiskyAllowed(true) + ->setRules( + [ + '@Symfony' => true, + 'header_comment' => ['header' => $header], + 'ordered_class_elements' => true, + 'ordered_imports' => true, + 'no_mixed_echo_print' => ['use' => 'print'], + 'strict_param' => true, + 'strict_comparison' => true, + 'single_import_per_statement' => false, + 'phpdoc_order' => true, + 'array_syntax' => ['syntax' => 'short'], + 'short_echo_tag' => false, + 'phpdoc_add_missing_param_annotation' => true, + 'psr4' => true, + 'no_extra_consecutive_blank_lines' => [ + 'break', + 'continue', + 'extra', + 'return', + 'throw', + 'parenthesis_brace_block', + 'square_brace_block', + 'curly_brace_block' + ], + ] + )->setFinder( + PhpCsFixer\Finder::create() + ->ignoreDotFiles(true) + ->ignoreVCS(true) + ->name('*.php') + ->in('src') + ->in('html') + ); \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9248e3c..ebbf62f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - composer.json - .gitignore +### Added +- .php_cs +- php-cs-fixer ## [0.0.1] - 2017-02-07 ### Added @@ -17,6 +20,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - source structure - html/index.php - ### Changed - docker-compose.yml, added mysql diff --git a/composer.json b/composer.json index 091b9a4..80830fe 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ }, "require-dev": { "phpunit/phpunit": "^6.0", - "fzaninotto/faker": "^1.6" + "fzaninotto/faker": "^1.6", + "friendsofphp/php-cs-fixer": "^2.0" }, "autoload": { "psr-0": { diff --git a/html/index.php b/html/index.php index c4837a3..73a6723 100644 --- a/html/index.php +++ b/html/index.php @@ -1 +1,21 @@ -. + */ + +phpinfo();