diff --git a/.env.dist b/.env.dist index 98443c495..565ca09cf 100644 --- a/.env.dist +++ b/.env.dist @@ -1,4 +1,5 @@ PHP_USER=php XDEBUG_MODE=debug -#docker-compose or "docker compose" for v1/v2 respectively -DOCKER_COMPOSE=docker-compose +PHP_CS_FIXER_IGNORE_ENV=true +#docker-compose or "docker compose" for v1/v2 respectively, note that v1 support ends 06/2023 +DOCKER_COMPOSE=docker compose diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index fa00d1d42..5f5a1ab5e 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -5,9 +5,8 @@ For repeatability and consistency across different operating systems, we use the Skipping the step above would result in a "`The "PHP_USER" variable is not set. Defaulting to a blank string`" warning -We use `docker` and `docker-compose` to perform a lot of our static analysis and testing. If you're planning to develop for this library, it'll help to install `docker engine` and `docker-compose`. - -The installation instructions for these tools are [here](https://docs.docker.com/install/), under the `Docker Engine` and `Docker Compose` submenus respectively. +We use `docker` and `docker compose` to perform a lot of our static analysis and testing. If you're planning to develop for this library, it'll help to install +[docker engine](https://docs.docker.com/engine/install/) and the [compose plugin](https://docs.docker.com/compose/install/). Development tasks are generally run through a `Makefile`. Running `make` or `make help` will list available targets. @@ -115,21 +114,21 @@ We use [Rector](https://github.com/rectorphp/rector) to automatically refactor o and upgrade the code to supported PHP versions. The associated configuration can be found [here](./.rector.php) -To refactor your code following our given standards, you can run: +If you want to check what changes would be applied by rector, you can run: ```bash make rector ``` +This command will simply print out the changes `rector` would make without actually changing any code. -This command applies the changes to the code base. -Make sure to run `make style` (see below) after running the `rector`command as the changes might not follow our coding standard. - -If you want to simply check what changes would be applied by rector, you can run: +To refactor your code following our given standards, you can run: ```bash -make rector-dry +make rector-write ``` -This command will simply print out the changes `rector`would make without actually changing any code. + +This command applies the changes to the code base. +Make sure to run `make style` (see below) after running the `rector`command as the changes might not follow our coding standard. ## Styling diff --git a/Makefile b/Makefile index 9dfc8ec63..f30c955bd 100644 --- a/Makefile +++ b/Makefile @@ -96,9 +96,9 @@ bash: ## bash shell into container $(DC_RUN_PHP) bash style: ## Run style check/fix $(DC_RUN_PHP) env XDEBUG_MODE=off env PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no -vvv -rector: ## Run rector +rector-write: ## Run rector $(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/rector process src -rector-dry: ## Run rector (dry-run) +rector: ## Run rector (dry-run) $(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/rector process src --dry-run deptrac: ## Run deptrac $(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/deptrac --formatter=table --report-uncovered --no-cache diff --git a/docker-compose.yaml b/docker-compose.yaml index 507f1c672..bd4fbcb94 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,11 +5,8 @@ services: volumes: - ./:/usr/src/myapp user: "${PHP_USER}:root" - environment: - XDEBUG_MODE: ${XDEBUG_MODE:-off} - XDEBUG_CONFIG: ${XDEBUG_CONFIG:-''} - PHP_IDE_CONFIG: ${PHP_IDE_CONFIG:-''} - #PHP_CS_FIXER_IGNORE_ENV: "true" + env_file: + - .env zipkin: image: openzipkin/zipkin-slim ports: