From 20ff41b60619706b9e619f4b8753f754c7b698c0 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sat, 30 Sep 2023 11:48:42 +0200 Subject: [PATCH] Add static analyzer dev environment --- docker-compose.yml | 6 ++++++ readme.md | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 75a62748..8d90fbff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,3 +7,9 @@ services: command: bash -c "composer install && ./vendor/bin/phpunit -vvv" volumes: - ./:/project + analysis: + build: ./ + working_dir: /project + command: bash -c "composer install && ./vendor/bin/phpstan analyze --level=4 ./src" + volumes: + - ./:/project diff --git a/readme.md b/readme.md index 0cd1f4d5..059f3f62 100644 --- a/readme.md +++ b/readme.md @@ -54,6 +54,20 @@ composer require intervention/image Learn the [basics](https://image.intervention.io/v3/basics/instantiation/) on how to use Intervention Image and more with the [official documentation](https://image.intervention.io/v3/). +## Development & Testing + +With this package comes a Docker image to build a test suite and analysis container. To build this container you have to have Docker installed on your system. You can run all tests with this command. + +```bash +docker-compose run --rm --build tests +``` + +Run the static analyzer on the code base. + +```bash +docker-compose run --rm --build analysis +``` + ## License Intervention Image is licensed under the [MIT License](http://opensource.org/licenses/MIT).