psr4-classname

Local Development

Contents

Introduction

This project provides a convenient dock script to simplify local development workflows within Docker containers.

You can use this script to initialize the project, manage Composer dependencies, and run tests in a consistent PHP environment.

Prerequisites

Initializing

Use the following commands to set up the project:

sh dock init
sh dock composer update

Testing

This command runs PHPUnit inside the Docker container, using the PHP version specified in your .env file. You can modify or extend this script to include additional tests or commands as needed.

sh dock test

Run the test suite with all versions of php:

sh test.sh

Configuration

Before starting development, verify that your .env file contains the correct settings.

You can specify which PHP version to use for local development, debugging, and Composer operations by updating these variables in your .env file:

PHP_VERSION=8.1
PHP_DEBUG=8.1
PHP_COMPOSER=8.1

Make sure these values reflect the PHP versions you intend to use. If the .env file does not exist, run the sh dock init command to create one from the .env.example template.