git clone git@github.com:imaginary-machines/imaginary-webhooks.git
composer install
plugin-machine plugin build --buildDir=build
plugin-machine plugin zip
PHP classes should be located in the "php" directory and follow the PSR-4 standard.
The root namespace is ImaginaryMachines\Webhooks
.
composer test:unit
composer test:wordpress
composer test
PHPCS is installed for linting and automatic code fixing.
composer fixes
compose sniffs
A docker-compose-based local development environment is provided.
docker-compose up -d
docker-compose run wpcli wp ...
docker-compose run wpcli wp core install --url=http://localhost:6080 --title="Imaginary Webhooks" --admin_user=admin0 --admin_email=something@example.com
docker-compose run wpcli wp user create admin admin@example.com --role=administrator --user_pass=pass
There is a special phpunit container for running WordPress tests, with WordPress and MySQL configured.
docker-compose run phpunit
composer install
composer test:wordpress