Skip to content
Quickly install and set up the necessary quality tools for your php project.
PHP
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Separate the install script Oct 10, 2019
src
tests
.gitignore
.rmt.yml
.scrutinizer.yml Travic, scrunitizer and style ci configs Oct 12, 2019
.styleci.yml Travic, scrunitizer and style ci configs Oct 12, 2019
.travis.yml
CHANGELOG
CHANGELOG.md Create the package Oct 10, 2019
CONTRIBUTING.md
LICENSE
LICENSE.md
README.md
RMT Install rmt Oct 11, 2019
composer.json
composer.lock Install rmt Oct 11, 2019
phpcs.xml Remove directory from xml put it as argument Oct 11, 2019
phpmd.xml Cleanup the phpmd.xml Oct 11, 2019
phpunit.xml.dist

README.md

PHP Quality Tools

Latest Version on Packagist Build Status Quality Score Total Downloads

This package installs the most commonly used quality tools for php: PHP Code Sniffer, PHP Mess Detector, PHP Static Analysis Tool and PHP Coding Standards Fixer. It comes with some reasonable predefined configurations and using the PSR-2 coding style. This package can be used with Laravel applications or with any php project it is not specifically a Laravel package.

The purpose of this package is to allow php developers to quickly install and configure all the necessary quality tools for their projects.

Installation

You can install the package via composer:

composer require --dev daniel-werner/php-quality-tools

After installing with composer, run the following command from the root directory of your project:

vendor/bin/phpqt-install

This will copy the default xml settings for the tools and to set up the scripts in the composer.json.

The install script will try to guess the source code directory in your project, if it is a Laravel application it will use the app directory, if it is a package it will use the src directory, otherwise the current directory.

You can pass the source code directory as the first argument of the install script, like this:

vendor/bin/phpqt-install my-app-src

After the installation the xml configurations can be found in your projects root directory. You can customize the phpcs and phpmd configurations by changing the settings in the xml files.

Usage

The package defines the following scripts in the composer.json:

  • composer inspect: this command runs the PHP Code Sniffer (phpcs) and the PHP Static Analysis Tool (phpstan). It will analyze your code style and run the phpstan with the default minimum level=0
  • composer inspect-fix: this command will try to fix the problems found by the inspection by running the PHP Coding Standards Fixer (php-cs-fixer) and the PHP Code Beautifier and Fixer (phpcbf).
  • composer insights: runs the PHP Mess Detector to find any potential issues in your code.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email vernerd@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate.

You can’t perform that action at this time.