Are you tired of copy-pasting your boilerplate PHP code whenever you need to start a new project?
This repository contains a single-line command that will automatically setup for you all the needed code to create a modern, clutter-free and test-oriented PHP package.
It will automatically install the following dependencies:
- PHPUnit: provides testing framework.
- PHP_CodeSniffer: detects violations of a defined set of coding standards.
- PHPMD: analyze your code to detect sub-optimal or overly complex code.
- PHPStan: discover bugs in your code without running it.
- Psalm: - another static analysis tool from Vimeo.
- PHPMetrics provides various metrics.
As well as config file for popular continuous integration tool.
To create your project, enter the following command in your console.
composer create-project koriym/php-skeleton <project-path>
You will be asked a few questions to configure the project:
What is the vendor name ?
(MyVendor):Koriym
What is the package name ?
(MyPackage):AwesomePackage
What is your name ?
(Akihito Koriyama):
What is your email address ?
(akihito.koriyama@gmail.com):
Once installed, the project will automatically be configured, so you can run those commands in the root of your application:
composer test
run phpunit
.
composer tests
run cs
, sa
, and test
.
composer coverage
builds test coverage report. coverage
use XDebug, phpdbg
use phpdbg. pcov
use pcov.
composer cs
checks coding standard. composer cs-fix
fix up the PHP code.
composer sa
run static code analysis tools. (phpstan and psalm)
composer metrics
reports code metrics.
composer build
builds all reports.