Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Variables plugin for PHP Codesniffer static analysis tool.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Sniffs Allowed function parameters to be unused without provoking unused-var… September 14, 2012
Octocat-spinner-32 Tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.mkdn
Octocat-spinner-32 install.sh
Octocat-spinner-32 ruleset.xml
README.mkdn

PHP_CodeSniffer VariableAnalysis

Plugin for PHP_CodeSniffer static analysis tool that adds analysis of problematic variable use.

  • Performs static analysis of variable use.
  • Warns on use of undefined variables.
  • Warns if variables are set or declared but never used within that scope.
  • Warns if variables are redeclared within same scope.
  • Warns if $this, self::$static_member, static::$static_member is used outside class scope.

INSTALLATION

Run ./install.sh -h to get install help.

For a default install of PHP_Codesniffer via PEAR with PEAR in ~/pear you should be safe to just run ./install.sh to use the default options, then copy the rules from ruleset.xml into your own ruleset.xml.

CUSTOMIZATION

There's a variety of options to customize the behaviour of VariableAnalysis, take a look at the included ruleset.xml for commented examples of a configuration.

KNOWN ISSUES & BUGS

  • File scope isn't currently analysed.
Something went wrong with that request. Please try again.