The development environment is managed with Docker by default.
First, make sure to install Docker Engine.
The docker
command must be executable by your normal user.
Clone the repository:
$ git clone [email protected]:flusio/Minz.git
Install the dependencies:
$ make install
A note about the make
commands: they might feel magic, but they are not!
They are just shortcuts for common commands.
If you want to know what they do, you can open the Makefile and locates the command that you are interested in.
They are hopefully easily readable by newcomers.
As the environment runs in Docker, you cannot run the php
(or the others) directly.
There are few scripts to allow to execute commands in the Docker containers easily:
$ ./docker/bin/php
$ ./docker/bin/composer
You can execute the tests with:
$ make test
Execute the tests of a specific file with the FILE=
parameter:
$ make test FILE=tests/path/to/file.php
Filter tests with the FILTER=
parameter (it takes a function name, or a part of it):
$ make test FILE=tests/path/to/file.php FILTER=testSomePattern
The previous command generates code coverage under the folder coverage/
.
To disable code coverage, run the command:
$ make test COVERAGE=
Execute the linters with:
$ make lint
You can run a specific linter with:
$ make lint LINTER=phpstan
$ make lint LINTER=rector
$ make lint LINTER=phpcs
Pull the changes with Git:
$ git pull
If dependencies have been added or updated, install them:
$ make install
Sometimes, you may also have to pull or rebuild the Docker images:
$ make docker-pull
$ make docker-build
If you encounter any problem with the Docker containers, you can clean them:
$ make docker-clean