php/skeleton

This package is abandoned and no longer maintained. The author suggests using the koriym/php-skeleton package instead.

Generic PHP project skeleton package

1.0.1 2018-04-24 03:11 UTC

README

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 ?

(akihito.koriyama@gmail.com):

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