Skip to content

burus86/template-php

Repository files navigation

template-php

  1. About project
  2. Set up project
  3. Unit Tests
  4. Functional Tests
  5. Code Quality Checker Tools
  6. Code Analysis Tools
  7. License

About project

  • PHP 8.1
  • Docker
  • Makefile
  • Unit tests: PHP Unit
  • Functional tests: Behat
  • Code Quality Checker Tools: PHP_CodeSniffer, PHPStan, PHP Mess Detector, PHP Magic Number Detector, PHP Copy Paste Detector, Churn-php, PhpDeprecationDetector
  • Code Analysis Tools: Deptrac

Set up project

Prerequisites

Installation

Clone repository:

git clone https://github.com/burus86/template-php.git
cd template-php

Build and up docker containers:

make start

Install composer dependencies:

make install

Execute project

Open in your favorite web browser the website http://localhost:8080/.

Captura

Execute all tests

To run all the tests (unit tests, functional tests, code quality checker tools and code analysis tools), just execute the command make test with option -i or --ignore-errors:

make test -i

If you prefer, it's also possible to run each individual test following the instructions below.

Unit Tests

make test-phpunit

Functional Tests

make test-behat

Code Quality Checker Tools

make test-phpcs

In order to automatically correct coding standard violations, execute:

make test-phpcbf
make test-phpstan
make test-phpmd
make test-phpmnd
make test-phpcpd

churn-php is a package that helps you identify php files in your project that could be good candidates for refactoring.

make test-churn
make test-phpdd

Code Analysis Tools

make test-deptrac

License

This project is licensed under the MIT License - see the LICENSE file for details.