diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..f9583ba --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,3 @@ +FROM mcr.microsoft.com/devcontainers/php:8.1-bookworm + +RUN pecl install grpc protobuf && docker-php-ext-enable grpc protobuf diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f7e27e8 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,33 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/php +{ + "name": "PHP", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "dockerFile": "Dockerfile", + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + }, + + // Configure tool-specific properties. + + "customizations" : { + "jetbrains" : { + "backend" : "IntelliJ", + "plugins": ["com.jetbrains.php"], + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [8080], + + "containerEnv": { + "MOMENTO_API_KEY": "${localEnv:MOMENTO_API_KEY}" + }, + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..911a1b2 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +.PHONY: install lint-check lint test + +install: + @echo "Installing dependencies..." + @composer install + +lint-check: + @echo "Checking code style..." + @php vendor/bin/php-cs-fixer fix --diff --dry-run --show-progress=none + +lint: + @echo "Fixing code style..." + @php vendor/bin/php-cs-fixer fix --diff --show-progress=none + +test: + @echo "Running tests..." + @php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml