Skip to content

Commit a5addc6

Browse files
committed
Improve the README very much
1 parent 620480e commit a5addc6

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

README.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,51 @@ Static analysis for the WordPress ecosystem.
1010
- [PHPStan](https://phpstan.org/)
1111
- [WordPress](https://wordpress.org/)
1212

13+
### Installation
14+
15+
Add this package to your project.
16+
17+
```bash
18+
composer require --dev szepeviktor/phpstan-wordpress
19+
```
20+
21+
Make PHPStan find it automatically using `phpstan/extension-installer`.
22+
23+
```bash
24+
composer require --dev phpstan/extension-installer
25+
```
26+
27+
Or manually include it in your `phpstan.neon`.
28+
29+
```neon
30+
includes:
31+
- vendor/szepeviktor/phpstan-wordpress/extension.neon
32+
```
33+
34+
### Configuration
35+
36+
Needs no extra configuration. :smiley: Simply configure PHPStan - for example - this way.
37+
38+
```neon
39+
parameters:
40+
level: 5
41+
paths:
42+
- plugin.php
43+
- inc/
44+
```
45+
46+
Please read [PHPStan Config Reference](https://phpstan.org/config-reference).
47+
48+
:bulb: Use Composer autoloader or a
49+
[custom autoloader](https://github.com/szepeviktor/debian-server-tools/blob/master/webserver/wp-install/wordpress-autoloader.php)!
50+
1351
### Usage
1452

15-
1. Set up Composer, add `szepeviktor/phpstan-wordpress`, autoload your plugin or theme, see `example/composer.json`
16-
1. Set up PHPStan, see `example/phpstan.neon.dist` - if you don't use Composer autoloading add `autoload_files:` and/or `autoload_directories:`
17-
1. Get packages `composer update --optimize-autoloader`
18-
1. Start analysis `vendor/bin/phpstan analyze`
53+
Just start the analysis: `vendor/bin/phpstan analyze`
54+
then fix an error and `GOTO 10`!
55+
56+
You find futher information in the `example` directory
57+
e.g. [`example/phpstan.neon.dist`](/example/phpstan.neon.dist)
1958

2059
### Usage in WooCommerce webshops
2160

0 commit comments

Comments
 (0)