Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README to include phpstan and linting #96

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@

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 variables are used without being defined.
* Warns if variables are set or declared but never used.
* Warns if $this, self::$static_member, static::$static_member is used outside class scope.

## Installation

### Requirements

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

### With PHPCS Composer Installer

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

Please open issues or PRs on this repository.

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.

To run tests, make sure composer is installed, then run:

```
composer install # you only need to do this once
composer test
```

To run linting, use:

```
composer lint
composer lint-self
```

To run static analysis, use:

```
composer phpstan
```