GNU social provides some tools to aid developers. Most of the more
common ones can be accessed with the
make command, for the
Makefile. These tools range from giving you acess to a
shell in the PHP docker container, a repl in the application
environment, a PostgreSQL shell, running PHPStan, among others.
pre-commit hook is provided, which gets installed when
composer install is run. This hook is responsible for running
multiple things that aid in maintaing code quality.
Specifically, we have setup:
- PHP Code Style fixer
- PHP Documenation Checker
These can be disabled for a given commit by prepending the command
with one of
SKIP_ALL, to disable the corresponding step.
SKIP_PHPSTAN=1 git commit
These should be used sparingly, but they're primarily useful for work in process commits and when rebasing.
Makefile for an up to date list of commands available, but
notable ones include:
php-shell- A shell in the PHP docker container, where you can run commands from the
binfolder (see below) or
php-repl- A REPL in the context of the application, allowing you to run function for testing. Note that this requires explicitly importing the needed classes with
use Class;like in a regular file
psql-shell- A PostgreSQL shell, if you need to edit the database contents manually
database-force-schema-update- If some entity changed, run this to add/remove/update any missing fields
test- Run PHPUnit tests
phpstan- Run PHPStan
These can be run by using
make php-repl, or the desired command
In addition, some useful scripts are provided in the
Typically, these should be run inside the Docker container. This can
be done by running
bin/console- The Symfony console
bin/generate_entity_fields- Update autogenerated entity code. Must be run after changing database definitions, i.e. when altering the
schemaDefstatic method in a class that extends
Check the Symfony Console reference for details on available commands.
In addition to those, we have added
app:events, which lists the
application events and their handlers and can be invoked as