Welcome to Stu’s Coding Tips—the one-stop shop for PHP package goodness! This project exists to make your coding life easier and save you from the hair-pulling moments that usually come with technical tests. The goal? To equip you with the tools to nail technical tests.
-
Docker Support: This package includes a sample Dockerfile and docker-compose.yml for easy development and testing. Please ensure you have Docker Desktop installed to get started.
-
Composer Scripts: Leverage Composer for dependency management. The repository comes with useful Composer scripts, including:
phpcs: For checking coding standards.phpmd: For code analysis.phpstan: For static analysis.rector: For automated code upgrades and refactoring.tests: Run tests found within thetestsdirectory.
-
Automated Testing: A GitHub Actions workflow is set up to automatically run tests whenever you push to the repository, ensuring your code remains reliable and up to standards.
-
Editable Code: You can modify the code in the
srcdirectory and add your own unit tests in thetestsdirectory to extend functionality. -
GitHub Template: The repository includes a template for pull requests that you can customise to fit your project needs.
-
Clone the Repository:
git clone git@github.com:stuarttodd-dev/coding-tips.git -
Navigate to repo:
cd coding-tips -
Set Up Docker: Ensure Docker Desktop is installed and running. Build Docker container:
docker compose build -
Spin up Docker Container: Run the Docker container:
docker compose up -d -
Install Dependencies: Inside your Docker container, install the project dependencies using Composer:
docker exec coding-tips composer install -
Run the Standards Check: Execute the following command to check coding standards and static analysis:
docker exec coding-tips composer standards:check -
Run Tests: Execute the following command to run tests:
docker exec coding-tips composer tests
Each folder within the src directory has it's own README file.