diff --git a/.php_cs.dist b/.php_cs.dist index 57cae650e..e9c61dff3 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -1,32 +1,47 @@ setRules(array_merge($config->getRules(), [ - 'header_comment' => ['header' => $header], - ])) - ->setUsingCache(false); - -return $config; +COMMENT; + +$finder = PhpCsFixer\Finder::create() + ->in(__DIR__) + ->ignoreDotFiles(true) + ->ignoreVCS(true) + ->exclude(array('build', 'vendor')) + ->files() + ->name('*.php') +; + +return PhpCsFixer\Config::create() + ->setFinder($finder) + ->setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + '@Symfony:risky' => true, + 'array_syntax' => ['syntax' => 'short'], + 'combine_consecutive_unsets' => true, + 'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'], + 'heredoc_to_nowdoc' => true, + 'linebreak_after_opening_tag' => true, + 'mb_str_functions' => true, + 'no_php4_constructor' => true, + 'no_unreachable_default_argument_value' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + 'phpdoc_summary' => false, + 'psr4' => true, + 'semicolon_after_instruction' => true, + 'strict_comparison' => true, + 'strict_param' => true, + ]) + ->setFinder($finder) + ->setUsingCache(true) +; diff --git a/.travis.yml b/.travis.yml index d2a354604..345169a14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,17 @@ env: global: - SYMFONY_DEPRECATIONS_HELPER="weak_vendors" - ENABLE_CODE_COVERAGE="false" + - RUN_UNIT_TESTS="true" + - CHECK_PHP_SYNTAX="false" matrix: fast_finish: true include: + - php: 7.1 - php: 7.1 + env: + - RUN_UNIT_TESTS="false" + - CHECK_PHP_SYNTAX="true" - php: 7.1 env: - SYMFONY_VERSION=4.0.* @@ -60,7 +66,9 @@ install: - if [[ "$ENABLE_CODE_COVERAGE" == "true" && "$TRAVIS_EVENT_TYPE" == "cron" ]]; then travis_retry composer require --dev satooshi/php-coveralls; fi script: - - if [[ "$ENABLE_CODE_COVERAGE" == "true" && "$TRAVIS_EVENT_TYPE" == "cron" ]]; then vendor/bin/simple-phpunit --coverage-text --coverage-clover build/logs/clover.xml; else vendor/bin/simple-phpunit -v; fi; + - if [[ "$ENABLE_CODE_COVERAGE" == "true" && "$TRAVIS_EVENT_TYPE" == "cron" ]]; then vendor/bin/simple-phpunit --coverage-text --coverage-clover build/logs/clover.xml; fi; + - if [[ "$RUN_UNIT_TESTS" == "true" && "$ENABLE_CODE_COVERAGE" == "false" ]]; then vendor/bin/simple-phpunit -v; fi; + - if [[ "$CHECK_PHP_SYNTAX" == "true" ]]; then vendor/bin/php-cs-fixer --dry-run --diff -v fix; fi; after_success: - if [[ "$ENABLE_CODE_COVERAGE" == "true" && "$TRAVIS_EVENT_TYPE" == "cron" ]]; then php vendor/bin/coveralls -v --config .coveralls.yml; fi;