Skip to content

Commit

Permalink
Restructure the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shochdoerfer committed Oct 4, 2022
1 parent 7605bef commit 1b76333
Showing 1 changed file with 19 additions and 32 deletions.
51 changes: 19 additions & 32 deletions README.md
Expand Up @@ -22,55 +22,42 @@ installing this extension. in your composer.json Change the PHPStan version to `
composer update phpstan/phpstan --with-all-dependencies
```

## Installation

The preferred way of installing `bitexpert/phpstan-magento` is through Composer.
You can add `bitexpert/phpstan-magento` as a dev dependency, as follows:

```
composer.phar require --dev bitexpert/phpstan-magento
```

> Want a full walk-through of the installation & configuration process? Read the blog post at M.academy about [Static Analysis in Magento with PHPStan](https://m.academy/blog/static-analysis-magento-phpstan/).
### PHPStan configuration

If you have not already a PHPStan configuration file `phpstan.neon` in your project, create a new empty file next to your `composer.json` file.

This PHPStan extension needs to be registered with PHPStan so that PHPStan can load it properly.
The easiest way to do this is to install the `phpstan/extension-installer` package as follows:
This PHPStan extension needs to be registered with PHPStan so that the extension gets loaded properly. The easiest way to do this is
to install the `phpstan/extension-installer` package as follows:

```
composer.phar require --dev phpstan/extension-installer
```

If you're using composer >= 2.2.0 you have to allow the execution of composer plugins ([see allow-plugins section](https://getcomposer.org/doc/06-config.md#allow-plugins)) as follows:
<details>
<summary>Composer Allow-PLugins configuration</summary>

If you're using Composer >= 2.2.0 you have to allow the execution of composer plugins ([see allow-plugins section](https://getcomposer.org/doc/06-config.md#allow-plugins)) as follows:

```
- Installing phpstan/extension-installer (1.1.0): Extracting archive
phpstan/extension-installer contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "phpstan/extension-installer" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
```

<details>
<summary>Manual installation</summary>
</details>

## Installation

If you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:
The preferred way of installing `bitexpert/phpstan-magento` is through Composer.
You can add `bitexpert/phpstan-magento` as a dev dependency, as follows:

```neon
includes:
- vendor/bitexpert/phpstan-magento/extension.neon
```
</details>
composer.phar require --dev bitexpert/phpstan-magento
```

If you are using phpstan-magento 0.15.0 and earlier, you need to register the custom autoloader that comes with this extension by adding `vendor/bitexpert/phpstan-magento/autoload.php`
as a bootstrap file. If you are using phpstan-magento > 0.15.0 this step is done automatically by the extension itself.
> Want a full walk-through of the installation & configuration process? Read the blog post at M.academy about [Static Analysis in Magento with PHPStan](https://m.academy/blog/static-analysis-magento-phpstan/).
```neon
parameters:
bootstrapFiles:
- vendor/bitexpert/phpstan-magento/autoload.php
```
### PHPStan configuration

If you have not already a PHPStan configuration file `phpstan.neon` in your project, create a new empty file next to your `composer.json` file.

See [here](https://phpstan.org/config-reference) what options PHPStan allows you to configure.

## Feature overview

Expand Down

0 comments on commit 1b76333

Please sign in to comment.