Skip to content

Commit 971b029

Browse files
authored
Update README to include phpstan and linting (#96)
1 parent c91ed28 commit 971b029

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@
44

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

7-
* Performs static analysis of variable use.
8-
* Warns on use of undefined variables.
9-
* Warns if variables are set or declared but never used within that scope.
10-
* Warns if variables are redeclared within same scope.
7+
* Warns if variables are used without being defined.
8+
* Warns if variables are set or declared but never used.
119
* Warns if $this, self::$static_member, static::$static_member is used outside class scope.
1210

1311
## Installation
1412

1513
### Requirements
1614

17-
VariableAnalysis requires PHP 5.4 or higher and [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) version **3.0.2** or higher.
15+
VariableAnalysis requires PHP 5.6 or higher and [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) version **3.0.2** or higher.
1816

1917
### With PHPCS Composer Installer
2018

@@ -95,9 +93,24 @@ This was forked from the excellent work in https://github.com/illusori/PHP_Codes
9593

9694
Please open issues or PRs on this repository.
9795

96+
Any changes should be accompanied by tests and should pass linting and static analysis. Please use phpdoc (rather than actual types) for declaring types since this must run in PHP 5.6.
97+
9898
To run tests, make sure composer is installed, then run:
9999

100100
```
101101
composer install # you only need to do this once
102102
composer test
103103
```
104+
105+
To run linting, use:
106+
107+
```
108+
composer lint
109+
composer lint-self
110+
```
111+
112+
To run static analysis, use:
113+
114+
```
115+
composer phpstan
116+
```

0 commit comments

Comments
 (0)