diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9b08815 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = LF + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab + +[*.yml] +indent_size = 2 diff --git a/.gitignore b/.gitignore index 0296b57..4992825 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ docs phpunit.xml psalm.xml vendor +infection.log diff --git a/Makefile b/Makefile index 37e9429..b07bb3a 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ help: @echo " test to perform tests." @echo " coverage to perform tests with code coverage." @echo " phpstan to run phpstan" + @echo " infection to run infection" install: composer install @@ -16,3 +17,8 @@ coverage: phpstan: php vendor/bin/phpstan analyse + +INFECTION_THREADS = $(shell sysctl -n hw.ncpu) + +infection: + php vendor/bin/infection --threads=$(INFECTION_THREADS) diff --git a/composer.json b/composer.json index a692be8..be7b1bb 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ }, "require-dev": { "phpunit/phpunit": "^7.5", - "phpstan/phpstan": "0.12.56" + "phpstan/phpstan": "0.12.56", + "infection/infection": "^0.20.2" } } diff --git a/infection.json.dist b/infection.json.dist new file mode 100644 index 0000000..eda367b --- /dev/null +++ b/infection.json.dist @@ -0,0 +1,13 @@ +{ + "source": { + "directories": [ + "src" + ] + }, + "logs": { + "text": "infection.log" + }, + "mutators": { + "@default": true + } +} \ No newline at end of file