diff --git a/.gitignore b/.gitignore index 17f57f67..2dc50e82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -/.php-cs-fixer/ -/.phpstan/ -/.phpunit/ -/.tmp/ +/.build/ /vendor/ diff --git a/.php_cs b/.php_cs index bc92a6df..0a00e424 100644 --- a/.php_cs +++ b/.php_cs @@ -27,15 +27,14 @@ $config->getFinder() ->ignoreDotFiles(false) ->in(__DIR__) ->exclude([ + '.build', '.github', - '.php-cs-fixer', - '.phpstan', '.travis', ]) ->name('.php_cs'); $directory = \getenv('TRAVIS') ? \getenv('HOME') : __DIR__; -$config->setCacheFile($directory . '/.php-cs-fixer/.php_cs.cache'); +$config->setCacheFile($directory . '/.build/php-cs-fixer/.php_cs.cache'); return $config; diff --git a/.travis.yml b/.travis.yml index 0d4d2d49..9aab504b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,9 @@ env: cache: directories: - $HOME/.composer/cache - - $HOME/.php-cs-fixer - - $HOME/.phpstan - - $HOME/.phpunit + - $HOME/.build/php-cs-fixer + - $HOME/.build/phpstan + - $HOME/.build/phpunit stages: - style @@ -32,29 +32,30 @@ jobs: - composer install before_script: - - mkdir -p $HOME/.php-cs-fixer + - mkdir -p $HOME/.build/php-cs-fixer script: - vendor/bin/php-cs-fixer fix --config=.php_cs --diff --dry-run --verbose - stage: Stan - php: 7.2 + php: 7.3 before_install: - source .travis/xdebug.sh - xdebug-disable - composer validate - if [[ -n "$GITHUB_TOKEN" ]]; then composer config github-oauth.github.com $GITHUB_TOKEN; fi + - if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer remove --dev localheinz/php-cs-fixer-config; fi install: - composer install before_script: - - mkdir -p $HOME/.phpstan + - mkdir -p $HOME/.build/phpstan script: - - vendor/bin/phpstan analyse --configuration=phpstan.neon src test + - vendor/bin/phpstan analyse --configuration=phpstan.neon - &TEST @@ -69,9 +70,9 @@ jobs: - xdebug-disable - composer validate - if [[ -n "$GITHUB_TOKEN" ]]; then composer config github-oauth.github.com $GITHUB_TOKEN; fi + - if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer remove --dev localheinz/php-cs-fixer-config; fi install: - - if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer remove --dev localheinz/php-cs-fixer-config; fi - if [[ "$WITH_LOWEST" == "true" ]]; then composer update --prefer-lowest; fi - if [[ "$WITH_LOCKED" == "true" ]]; then composer install; fi - if [[ "$WITH_HIGHEST" == "true" ]]; then composer update; fi diff --git a/Makefile b/Makefile index 1768f9e9..aafefa11 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,12 @@ coverage: vendor vendor/bin/phpunit --configuration=test/Integration/phpunit.xml --coverage-text cs: vendor - mkdir -p .php-cs-fixer + mkdir -p .build/php-cs-fixer vendor/bin/php-cs-fixer fix --config=.php_cs --diff --verbose stan: vendor - mkdir -p .phpstan - vendor/bin/phpstan analyse --configuration=phpstan.neon src test + mkdir -p .build/phpstan + vendor/bin/phpstan analyse --configuration=phpstan.neon test: vendor vendor/bin/phpunit --configuration=test/Integration/phpunit.xml diff --git a/phpstan.neon b/phpstan.neon index 6ac7931b..c2e1da9d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -11,4 +11,7 @@ parameters: - '#Method Localheinz\\Composer\\Normalize\\Command\\NormalizeCommand::__construct\(\) has parameter \$differ with null as default value.#' - '#Method Localheinz\\Composer\\Normalize\\Command\\NormalizeCommand::__construct\(\) has parameter \$formatter with null as default value.#' - '#Method Localheinz\\Composer\\Normalize\\Command\\NormalizeCommand::indentFrom\(\) has a nullable return type declaration.#' - tmpDir: %currentWorkingDirectory%/.phpstan + paths: + - src + - test + tmpDir: %currentWorkingDirectory%/.build/phpstan diff --git a/test/Integration/NormalizeTest.php b/test/Integration/NormalizeTest.php index e9588cc1..66eb1e70 100644 --- a/test/Integration/NormalizeTest.php +++ b/test/Integration/NormalizeTest.php @@ -1035,7 +1035,7 @@ private static function temporaryDirectory(): string $projectDirectory = \realpath(__DIR__ . '/../..'); return \sprintf( - '%s/.tmp', + '%s/.build/fixture', $projectDirectory ); } diff --git a/test/Integration/phpunit.xml b/test/Integration/phpunit.xml index a3ea0d20..c156a382 100644 --- a/test/Integration/phpunit.xml +++ b/test/Integration/phpunit.xml @@ -9,7 +9,7 @@ beStrictAboutTodoAnnotatedTests="true" bootstrap="../../vendor/autoload.php" cacheResult="true" - cacheResultFile="../../.phpunit/unit.cache" + cacheResultFile="../../.build/phpunit/unit.cache" colors="true" columns="max" convertErrorsToExceptions="true"