Skip to content

koriym/Koriym.PhpSkeleton

Repository files navigation

A standard PHP project skeleton

Build Status

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 6.x: run your unit tests.
  • PHP_CodeSniffer: validate your code against code convention.
  • PHP CS Fixer: automatically fix your code to match the code convention.
  • PHPMD: analyze your code to detect sub-optimal or overly complex code.
  • PHPStan: analyze your code without running it to find bugs even before you write tests for the code.

As well as config file for popular continuous integration tool.

Create Project

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 ?

([email protected]):

Composer Commands

Once installed, the project will automatically be configured so you can run those commands in the root of your application:

test

composer test run phpunit.

tests

composer tests run phpcs, php-cs-fixer, phpmd, phpstan and phpunit.

coverage

composer coverage builds test coverage report.

cs-fix

composer cs-fix run php-cs-fixer and phpcbf to fix up the PHP code to follow the coding standards. (Check only command compposer cs is also available.)

Setup continuous integration