2017 © Pedro Peláez
 

library phpqaconfig

PHP QA and development tool configuration for LoVullo Associates.

image

lovullo/phpqaconfig

PHP QA and development tool configuration for LoVullo Associates.

  • Tuesday, July 24, 2018
  • by lovullo
  • Repository
  • 8 Watchers
  • 0 Stars
  • 13,412 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 51 Versions
  • 8 % Grown

The README.md

phpqaconfig

Configuration for QA and development tools specific to the coding standards at LoVullo Associates. This package, combined with lovullo/phpqatools is meant to be a base for new PHP projects., (*1)

Installation

Simply require it in your project's composer.json, (*2)

    "require-dev": {
        "lovullo/phpqaconfig": "@stable"
    }

Or, (*3)

$ composer require --dev lovullo/phpqaconfig

Usage

Project Setup

Create a build.xml file in your project root with the following contents:, (*4)

<?xml version="1.0" encoding="utf-8"?>
<project name="project-name">
  <import file="${basedir}/vendor/lovullo/phpqaconfig/build.xml" />
</project>

Create a phpunit.xml file in your project root with the following contents:, (*5)


<phpunit verbose="true">
  <testsuites>
    <testsuite name="ProjectName">
      <directory suffix="Test.php">tests/</directory>
    </testsuite>
  </testsuites>

  <logging>
    <log type="coverage-html" target="build/coverage"/>
    <log type="coverage-clover" target="build/logs/clover.xml"/>
    <log type="coverage-crap4j" target="build/logs/crap4j.xml"/>
    <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
  </logging>
</phpunit>

See the "Customizing" section below if you have an existing PHPUnit configuration elsewhere., (*6)

Development

When developing, use the following ant targets:, (*7)

  • composer
  • phpunit
  • phpcs
  • phpmd
  • phpcpd
  • phploc

For example:, (*8)

$ ant phpcs phpmd phpcpd

Continuous Integration

When configuring Continuous Integration (ie. Jenkins), composer must download and install this repo before you can run ant tasks. Add an "Execute Shell" build step to Jenkins with the following command:, (*9)

$ composer install -o

Next, add an "Invoke Ant" build step with the following target:, (*10)

build-qa

This will run check_mergeconflicts, phplint, phpunit, phpcs-ci, pdepend, phpmd-ci, phpcpd-ci, phploc-ci, and phpdox., (*11)

For jobs that need to run quickly and only need a minimal number of QA checks, run the following targets instead:, (*12)

build-quick

This will run check_mergeconflicts, phplint, and phpunit., (*13)

Add additional build targets to your build.xml file as appropriate for your particular project., (*14)

Customizing

QA Tools Location

The included build.xml assumes that all the QA tools are installed into ./vendor/bin. If they are installed elsewhere, provide a toolsdir property to their location:, (*15)


<project name="project-name">
  <property name="toolsdir" value="${basedir}/bin/" />

  <import file="${basedir}/vendor/lovullo/phpqaconfig/build.xml" />
</project>

PHP Lint Configuration

By default, the included build.xml runs php -l on all PHP files in the project except for the vendor/ directory in the root of your project. You can override this setting using the phplintignore property:, (*16)


<project name="project-name">
  <property name="phplintignore" value="components/**/*,vendor/**/*" />

  <import file="${basedir}/vendor/lovullo/phpqaconfig/build.xml" />
</project>

PHPUnit Configuration

By default, the included build.xml assumes that there is a phpunit.xml file in the same directory as itself. If you already have a phpunit.xml file located somewhere else, you can override the configuration as follows:, (*17)


<project name="project-name">
  <property name="phpunitconfig" value="${basedir}/app/" />

  <import file="${basedir}/vendor/lovullo/phpqaconfig/build.xml" />
</project>

PHP_CodeSniffer Configuration

You can customize the files that are ignored in phpcs checks by specifying a phpcsignore property:, (*18)


<project name="project-name">
  <property name="phpcsignore" value="app/,bin/,vendor/,web/" />

  <import file="${basedir}/vendor/lovullo/phpqaconfig/build.xml" />
</project>

By default, only the vendor directory is excluded from checks., (*19)

You can change what PHP_CodeSniffer standard uses by overriding the phpcsstandard property:, (*20)


<project name="project-name">
  <property name="phpcsstandard" value="PSR1,PSR2" />

  <import file="${basedir}/vendor/lovullo/phpqaconfig/build.xml" />
</project>

PHPMD Configuration

You can customize the files that are ignored in phpmd checks by specifying a phpmdignore property:, (*21)


<project name="project-name">
  <property name="phpmdignore" value="app,bin,vendor,web" />

  <import file="${basedir}/vendor/lovullo/phpqaconfig/build.xml" />
</project>

By default, only the vendor directory is excluded from checks., (*22)

PHPCPD Configuration

You can customize the files that are ignored in phpcpd checks by specifying a phpcpdignore property:, (*23)


<project name="project-name">
  <property name="phpcpdignore" value="--exclude vendor --exclude app" />

  <import file="${basedir}/vendor/lovullo/phpqaconfig/build.xml" />
</project>

By default, only the vendor directory is excluded from checks., (*24)

phpDox Configuration


<phpdox xmlns="http://xml.phpdox.net/config" silent="true">
    <bootstrap />

    <project name="phpdox" source="${basedir}/src" workdir="${basedir}/build/phpdox/xml">
        <collector publiconly="false" backend="parser">
            <include mask="*.php" />
            <inheritance resolve="true" />
        </collector>

        <generator output="${basedir}/build/docs">
            <enrich base="${basedir}/build">
                <source type="build" />

                <source type="phploc">
                    <file name="logs/phploc.xml" />
                </source>

                <source type="git">
                    <git binary="git" />
                    <history enabled="true" limit="15" cache="${phpDox.project.workdir}/gitlog.xml" />
                </source>

                <source type="checkstyle">
                    <file name="logs/checkstyle.xml" />
                </source>

                <source type="phpunit">
                    <file name="logs/phpunit" />
                </source>

                <source type="pmd">
                    <file name="logs/pmd.xml" />
                </source>
            </enrich>

            <build engine="html" enabled="true" output="html">
                <template dir="${phpDox.home}/templates/html" />
                <file extension="html" />
            </build>
        </generator>
    </project>
</phpdox>

Disabling QA Checks

If you do not want certain QA tools to run for a project, add one or more of the following disable properties prior to including the base build.xml file:, (*25)


<project name="project-name">
  <property name="disable-phpunit" value="true" />
  <property name="disable-pdepend" value="true" />
  <property name="disable-phpmd" value="true" />
  <property name="disable-phpcs" value="true" />
  <property name="disable-phpcpd" value="true" />

  <import file="${basedir}/vendor/lovullo/phpqaconfig/build.xml" />
</project>

The Versions

24/07 2018

dev-master

9999999-dev

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

24/07 2018

1.1.3

1.1.3.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

07/06 2017

1.1.2

1.1.2.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

23/05 2017

1.1.1

1.1.1.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

04/05 2017

1.1.0

1.1.0.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

21/02 2017

1.0.46

1.0.46.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

20/02 2017

1.0.45

1.0.45.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

30/01 2017

1.0.44

1.0.44.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

18/07 2016

1.0.29

1.0.29.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

18/07 2016

1.0.28

1.0.28.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

09/06 2016

1.0.27

1.0.27.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

09/06 2016

1.0.25

1.0.25.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

09/06 2016

1.0.26

1.0.26.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

06/06 2016

1.0.24

1.0.24.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

06/06 2016

1.0.23

1.0.23.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

06/06 2016

1.0.22

1.0.22.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

03/06 2016

1.0.21

1.0.21.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

29/04 2016

1.0.20

1.0.20.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

02/10 2015

1.0.19

1.0.19.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

20/08 2015

1.0.18

1.0.18.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

10/07 2015

1.0.17

1.0.17.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

13/02 2015

1.0.16

1.0.16.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

23/01 2015

1.0.15

1.0.15.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

23/01 2015

1.0.14

1.0.14.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

23/01 2015

1.0.13

1.0.13.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

23/01 2015

1.0.12

1.0.12.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

23/01 2015

1.0.11

1.0.11.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

20/01 2015

1.0.10

1.0.10.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

20/01 2015

1.0.9

1.0.9.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

20/01 2015

1.0.8

1.0.8.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

19/11 2014

1.0.7

1.0.7.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

19/11 2014

1.0.6

1.0.6.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

18/11 2014

1.0.5

1.0.5.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

18/11 2014

1.0.4

1.0.4.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

18/11 2014

1.0.3

1.0.3.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

18/11 2014

1.0.2

1.0.2.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

18/11 2014

1.0.1

1.0.1.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa

18/11 2014

1.0.0

1.0.0.0

PHP QA and development tool configuration for LoVullo Associates.

  Sources   Download

GPL-3.0+

The Requires

 

php configuration tools qa