PHPCheckstyle is an open-source tool that helps PHP programmers adhere to certain coding conventions.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
checkstyle_result Moved CheckStyleConfig into an abstract class, CheckXMLStyleConfig Aug 19, 2014
config #82 : Cannot define independent rules for function parameter namings and Aug 21, 2017
html #93 : Use Bootstrap4 for styling Sep 7, 2018
src/PHPCheckstyle #92 : checkWhiteSpaceBefore {, unless it's in Aug 10, 2018
test #92 : checkWhiteSpaceBefore {, unless it's in Aug 10, 2018
vagrant_config/scripts #89 : False error "The function parameters must match those in its Aug 6, 2018
vendor Add a default autoloader in case we're not using Composer Jan 6, 2017
.gitignore Add Vagrant config as an option to test the project Feb 6, 2017
.travis.yml Self-use on Travis (3) Oct 20, 2017
LICENSE Change licensing scheme. From OSL 2.1 to LGLP v3 Jan 29, 2018
README.md Add Travis Status to readme Feb 10, 2017
RELEASE_NOTES.txt #93 : Use Bootstrap4 for styling Sep 7, 2018
Vagrantfile #62 : Manage short array syntax Feb 10, 2017
build.xml Improved indentation in XMLs Sep 14, 2014
composer.json Update composer.json May 19, 2017
index.php Improved indentation Sep 14, 2014
phpcheckstyle #87 : Could not open input file: vendor/bin/run.php Dec 11, 2017
phpcheckstyle.cmd Removed trailing whitespace; unified EOL to unix Sep 14, 2014
phpcheckstyle.sh #89 : False error "The function parameters must match those in its Aug 6, 2018
phpunit.sh Make phpunit.sh executable Oct 20, 2017
phpunit.xml #89 : False error "The function parameters must match those in its Aug 6, 2018
run.php #86 : max-errors parameter Nov 10, 2017
runFromWeb.php Fixed very long lines Sep 14, 2014

README.md

PHPCheckstyle

Build Status

Overview

PHPCheckstyle is an open-source tool that helps PHP programmers adhere to certain coding conventions. The tools checks the input PHP source code and reports any deviations from the coding convention.

The tool uses the PEAR Coding Standards as the default coding convention. But it allows you to configure it to suit your coding standards.

Please visit https://github.com/PHPCheckstyle/phpcheckstyle/wiki for more information and documentation

Requirements

  • PHP 5.0 or newer.
  • Web browser to view the checkstyle report (only for html view)
  • That's all.

Installation

Installation with Composer

composer require phpcheckstyle/phpcheckstyle

or Add phpcheckstyle/phpcheckstyle as a requirement to composer.json:

{
    "require": {
        "phpcheckstyle/phpcheckstyle": "dev-master"
    }
}

Update your packages with composer update or if installing from fresh, with composer install.

Manual Installation

Just download https://github.com/PHPCheckstyle/phpcheckstyle/archive/master.zip and unzip the distribution.

$> unzip PhpCheckstyle.zip

This will create a directory called phpcheckstyle and expand all files in it.

Testing with Vagrant

  • install VirtualBox

  • install Vagrant

  • launch vagrant up in the project root directory to start the VM

  • In case of problem with the "guest additions", launch :

vagrant plugin install vagrant-vbguest

  • to run PHPCheckstyle on itself, type vagrant provision --provision-with run_phpcheckstyle
  • to run PHPUnit, type vagrant provision --provision-with run_phpunit
  • to log inside the VM, type vagrant ssh

Usage

  • Change directory to the PHPCheckstyle installation directory.

    $> cd phpcheckstyle
  • Execute the run.php script providing the --src option.

    $> php run.php --src <php source directory/file>
  • Use the --help option to see more options

    $> php run.php --help

License

See LICENSE