This project has been moved to https://gitlab.com/webqard/resto This repository will no longer be maintained.
This is a restaurant API.
This API is not fit for production in its current state. Its features may changed without warning.
user@host ~$ cd [PATH_WHERE_TO_PUT_THE_PROJECT] # E.g. ~/projects/
user@host projects$ git clone https://github.com/webqard/resto-api.git
user@host projects$ cd resto-api
Copy the variables in the .env.dist
file to your .env*
file and fill in the values.
user@host resto-api$ composer install -o [--no-dev]
The "--no-dev" option is for the production environment.
user@host resto-api$ ./vendor/bin/openapi -o ./public/api.json ./src/
user@host resto-api$ ./bin/console doctrine:database:create [-e test]
user@host resto-api$ ./bin/console make:migration [-e test]
user@host resto-api$ ./bin/console doctrine:migrations:migrate [--no-interaction] [-e test]
The "-e test" option is to for the test environment which uses Sqlite.
user@host resto-api$ ./bin/console lexik:jwt:generate-keypair [-n] [--skip-if-exists] [--overwrite] [-e test]
First, you need to install phive dependencies :
user@host resto-api$ phive install --trust-gpg-keys 4AA394086372C20A,12CE0F1D262429A5,31C7E470E2138192,8AC0BAA79732DD42,C5095986493B4AA0
To run the tests :
user@host resto-api$ ./tools/phpunit -c ./ci/phpunit.xml
The generated outputs will be in ./ci/phpunit/
.
Look at ./ci/phpunit/html/index.html
for code coverage
and ./ci/phpunit/testdox.html
for a verbose list of passing / failing tests.
To run mutation testing, you must run PHPUnit first, then :
user@host resto-api$ ./tools/infection -c./ci/infection.json
The generated outputs will be in ./ci/infection/
.
To do a static analysis :
user@host resto-api$ ./tools/psalm -c ./ci/psalm.xml [--report=./psalm/psalm.txt --output-format=text]
Use "--report=./psalm/psalm.txt --output-format=text" if you want the output in a file instead of on screen.
To generate the PHPDoc :
user@host resto-api$ ./tools/phpdocumentor --config ./ci/phpdoc.xml
The generated HTML documentation will be in ./ci/phpdoc/
.
All PHP files in this project follows PSR-12. To indent the code :
user@host resto-api$ ./tools/phpcbf --standard=PSR12 --extensions=php --ignore=*/Kernel.php -p ./src/ ./tests/