Skip to content

Commit 52a2cd1

Browse files
committed
Update README
1 parent f1bfd2c commit 52a2cd1

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

README.mkdn

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
1-
PHP_CodeSniffer VariableAnalysis
2-
================================
1+
# PHP_CodeSniffer VariableAnalysis
32

4-
Plugin for PHP_CodeSniffer static analysis tool that adds analysis of problematic
5-
variable use.
3+
Plugin for PHP_CodeSniffer static analysis tool that adds analysis of problematic variable use.
64

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

13-
INSTALLATION
14-
------------
11+
## Installation
1512

16-
Run ./install.sh -h to get install help.
13+
### Requirements
1714

18-
For a default install of PHP_Codesniffer via PEAR with PEAR in ~/pear you should be
19-
safe to just run ./install.sh to use the default options, then copy the rules from
20-
ruleset.xml into your own ruleset.xml.
15+
VariableAnalysis requires PHP 5.4 or higher and [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) version **3.0.2** or higher.
2116

22-
CUSTOMIZATION
23-
-------------
17+
### Standalone
18+
19+
1. Install PHP_CodeSniffer by following its [installation instructions](https://github.com/squizlabs/PHP_CodeSniffer#installation) (via Composer, Phar file, PEAR, or Git checkout).
20+
21+
Do ensure that PHP_CodeSniffer's version matches our [requirements](#requirements)
22+
23+
2. Clone the repository:
24+
25+
git clone -b master https://github.com/sirbrillig/VariableAnalysis.git VariableAnalysis
26+
27+
3. Add its path to the PHP_CodeSniffer configuration:
28+
29+
phpcs --config-set installed_paths /path/to/VariableAnalysis
30+
31+
If you already have installed paths, [use a comma to separate them](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-installed-standard-paths).
32+
33+
## Customization
2434

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

28-
KNOWN ISSUES & BUGS
29-
-------------------
38+
## Original
3039

31-
* File scope isn't currently analysed.
40+
This was forked from the excellent work in https://github.com/illusori/PHP_Codesniffer-VariableAnalysis

0 commit comments

Comments
 (0)