Skip to content

Commit

Permalink
Improve the README very much
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Oct 25, 2020
1 parent 620480e commit a5addc6
Showing 1 changed file with 43 additions and 4 deletions.
47 changes: 43 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,51 @@ Static analysis for the WordPress ecosystem.
- [PHPStan](https://phpstan.org/)
- [WordPress](https://wordpress.org/)

### Installation

Add this package to your project.

```bash
composer require --dev szepeviktor/phpstan-wordpress
```

Make PHPStan find it automatically using `phpstan/extension-installer`.

```bash
composer require --dev phpstan/extension-installer
```

Or manually include it in your `phpstan.neon`.

```neon
includes:
- vendor/szepeviktor/phpstan-wordpress/extension.neon
```

### Configuration

Needs no extra configuration. :smiley: Simply configure PHPStan - for example - this way.

```neon
parameters:
level: 5
paths:
- plugin.php
- inc/
```

Please read [PHPStan Config Reference](https://phpstan.org/config-reference).

:bulb: Use Composer autoloader or a
[custom autoloader](https://github.com/szepeviktor/debian-server-tools/blob/master/webserver/wp-install/wordpress-autoloader.php)!

### Usage

1. Set up Composer, add `szepeviktor/phpstan-wordpress`, autoload your plugin or theme, see `example/composer.json`
1. Set up PHPStan, see `example/phpstan.neon.dist` - if you don't use Composer autoloading add `autoload_files:` and/or `autoload_directories:`
1. Get packages `composer update --optimize-autoloader`
1. Start analysis `vendor/bin/phpstan analyze`
Just start the analysis: `vendor/bin/phpstan analyze`
then fix an error and `GOTO 10`!

You find futher information in the `example` directory
e.g. [`example/phpstan.neon.dist`](/example/phpstan.neon.dist)

### Usage in WooCommerce webshops

Expand Down

3 comments on commit a5addc6

@szepeviktor
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreasciamanna Please review the new README as you are my perfect user :)
All comments are welcome!

https://github.com/szepeviktor/phpstan-wordpress/blob/master/README.md

@andreasciamanna
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@szepeviktor It looks alright to me 👍

@szepeviktor
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Please sign in to comment.