Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Convenience wrapper for HHVM
PHP
Tree: f869455543

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
build
src
.gitattributes
.gitignore
ChangeLog.markdown
LICENSE
README.markdown
build.xml
hphpa.php
ruleset.xml

README.markdown

hphpa

hphpa is a convenience wrapper for HipHop's static analyzer.

Installation

hphpa should be installed using the PEAR Installer, the backbone of the PHP Extension and Application Repository that provides a distribution system for PHP packages.

Depending on your OS distribution and/or your PHP environment, you may need to install PEAR or update your existing PEAR installation before you can proceed with the following instructions. sudo pear upgrade PEAR usually suffices to upgrade an existing PEAR installation. The PEAR Manual explains how to perform a fresh installation of PEAR.

The following two commands (which you may have to run as root) are all that is required to install hphpa using the PEAR Installer:

pear config-set auto_discover 1
pear install pear.phpunit.de/hphpa

After the installation you can find the hphpa source files inside your local PEAR directory; the path is usually /usr/lib/php/SebastianBergmann/HPHPA.

Usage Example

➜  ~  hphpa --checkstyle hphpa.xml /usr/local/src/code-coverage/PHP
hphpa 1.1.0 by Sebastian Bergmann.

Using ruleset /usr/share/pear/data/hphpa/ruleset.xml

/usr/local/src/code-coverage/PHP/CodeCoverage/Filter.php
  206   Too many arguments in function or method call:
        $this->addFileToWhitelist($file, FALSE)

Found 1 violation in 1 file (out of 21 total files).

➜  ~  cat hphpa.xml
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle>
 <file name="/usr/local/src/code-coverage/PHP/CodeCoverage/Filter.php">
  <error line="206"
         message="Too many arguments in function or method call:
                  $this-&gt;addFileToWhitelist($file, FALSE)"
         source="HipHop.PHP.Analysis.TooManyArgument"
         severity="error"/>
 </file>
</checkstyle>
Something went wrong with that request. Please try again.