<commit_before>.DEFAULT_GOAL := help

PHP_VERSION ?= 7.2

#
### DOCKER
# --------
#

.PHONY: dev
docker.dev: ## Prepare the env file before running docker
	cp .env.dist .env

.PHONY: build
docker.build: ## Build the PHP docker image
	docker-compose build php${PHP_VERSION}

.PHONY: install-deps
docker.deps: ## Install dependencies
	docker/run-task php${PHP_VERSION} composer install

.PHONY: install-all-deps
docker.all-deps: docker.deps ## Install dependencies
	docker/run-task php${PHP_VERSION} composer require --no-update \
		aws/aws-sdk-php:^3.158 \
		google/apiclient:^2.12 \
		doctrine/dbal:^2.3 \
		league/flysystem:^1.0 \
		microsoft/azure-storage-blob:^1.0 \
		phpseclib/phpseclib:^2.0 \
		mongodb/mongodb:^1.1 \
		async-aws/simple-s3:^0.1.1

.PHONY: tests
docker.tests: ## Run tests
	docker/run-task php${PHP_VERSION} bin/tests

.PHONY: php-cs-compare
docker.php-cs-compare: ## Run CS fixer (dry run)
	docker/run-task php${PHP_VERSION} vendor/bin/php-cs-fixer fix \
		--diff \
		--dry-run \
		--show-progress=none \
		--verbose

.PHONY: php-cs-fix
docker.php-cs-fix: ## Run CS fixer
	docker/run-task php${PHP_VERSION} vendor/bin/php-cs-fixer fix

#
### LOCAL TASKS
# -------
#

remove-phpspec: ## Remove adapter specs (allows you to run test suite without adapters deps)
	rm spec/Gaufrette/Adapter/AsyncAwsS3Spec.php
	rm spec/Gaufrette/Adapter/AwsS3Spec.php
	rm spec/Gaufrette/Adapter/GoogleCloudStorageSpec.php
	rm spec/Gaufrette/Adapter/DoctrineDbalSpec.php
	rm spec/Gaufrette/Adapter/FlysystemSpec.php
	rm -r spec/Gaufrette/Adapter/AzureBlobStorage
	rm spec/Gaufrette/Adapter/GridFSSpec.php
	rm spec/Gaufrette/Adapter/PhpseclibSftpSpec.php

require-all-legacy: # kept for compatibility with the old CI config, to be removed at some point
	composer require --no-update \
		aws/aws-sdk-php:^3.158 \
		google/apiclient:^2.12 \
		doctrine/dbal:^2.3 \
		league/flysystem:^1.0 \
		microsoft/azure-storage-blob:^1.0 \
		phpseclib/phpseclib:^2.0 \
		mongodb/mongodb:^1.1


require-all: require-all-legacy ## Install all dependencies for adapters
	composer require --no-update async-aws/simple-s3:^1.0

.PHONY: clear
clear: ## Remove not versioned files
	rm -rf vendor/ composer.lock

test.phpstan: ## Run phpstan analysis
	php vendor/bin/phpstan analyze --memory-limit 1G
<commit_msg>:construction_worker: Add BC Check to Makefile (#675)<commit_after>.DEFAULT_GOAL := help

PHP_VERSION ?= 7.2
export ROOT_DIR=${PWD}

#
### DOCKER
# --------
#

.PHONY: dev
docker.dev: ## Prepare the env file before running docker
	cp .env.dist .env

.PHONY: build
docker.build: ## Build the PHP docker image
	docker-compose build php${PHP_VERSION}

.PHONY: install-deps
docker.deps: ## Install dependencies
	docker/run-task php${PHP_VERSION} composer install

.PHONY: install-all-deps
docker.all-deps: docker.deps ## Install dependencies
	docker/run-task php${PHP_VERSION} composer require --no-update \
		aws/aws-sdk-php:^3.158 \
		google/apiclient:^2.12 \
		doctrine/dbal:^2.3 \
		league/flysystem:^1.0 \
		microsoft/azure-storage-blob:^1.0 \
		phpseclib/phpseclib:^2.0 \
		mongodb/mongodb:^1.1 \
		async-aws/simple-s3:^0.1.1

.PHONY: tests
docker.tests: ## Run tests
	docker/run-task php${PHP_VERSION} bin/tests

.PHONY: php-cs-compare
docker.php-cs-compare: ## Run CS fixer (dry run)
	docker/run-task php${PHP_VERSION} vendor/bin/php-cs-fixer fix \
		--diff \
		--dry-run \
		--show-progress=none \
		--verbose

.PHONY: php-cs-fix
docker.php-cs-fix: ## Run CS fixer
	docker/run-task php${PHP_VERSION} vendor/bin/php-cs-fixer fix

#
### LOCAL TASKS
# -------
#

remove-phpspec: ## Remove adapter specs (allows you to run test suite without adapters deps)
	rm spec/Gaufrette/Adapter/AsyncAwsS3Spec.php
	rm spec/Gaufrette/Adapter/AwsS3Spec.php
	rm spec/Gaufrette/Adapter/GoogleCloudStorageSpec.php
	rm spec/Gaufrette/Adapter/DoctrineDbalSpec.php
	rm spec/Gaufrette/Adapter/FlysystemSpec.php
	rm -r spec/Gaufrette/Adapter/AzureBlobStorage
	rm spec/Gaufrette/Adapter/GridFSSpec.php
	rm spec/Gaufrette/Adapter/PhpseclibSftpSpec.php

require-all-legacy: # kept for compatibility with the old CI config, to be removed at some point
	composer require --no-update \
		aws/aws-sdk-php:^3.158 \
		google/apiclient:^2.12 \
		doctrine/dbal:^2.3 \
		league/flysystem:^1.0 \
		microsoft/azure-storage-blob:^1.0 \
		phpseclib/phpseclib:^2.0 \
		mongodb/mongodb:^1.1


require-all: require-all-legacy ## Install all dependencies for adapters
	composer require --no-update async-aws/simple-s3:^1.0

.PHONY: bc-check
bc-check: ## Check for backward compatibility change
	docker run -v ${ROOT_DIR}:/app --rm nyholm/roave-bc-check

.PHONY: clear
clear: ## Remove not versioned files
	rm -rf vendor/ composer.lock

test.phpstan: ## Run phpstan analysis
	php vendor/bin/phpstan analyze --memory-limit 1G

{'fraction_non_alphanumeric': 0.1380104712041885, 'fraction_numerical': 0.019895287958115182, 'mean_word_length': 3.6731898238747553, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3880808', 'n_tokens_mistral': 1972, 'n_tokens_neox': 1812, 'n_words': 380}