# shopware plugins mit phan prüfen

**URL:** <https://forum.shopware.com/t/shopware-plugins-mit-phan-prufen/54090>\
**Category:** Programmierung\
**Created:** [16. Juli 2018 um 10:35 UTC](https://forum.shopware.com/t/shopware-plugins-mit-phan-prufen/54090 "2018-07-16T10:35:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wontfix](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@wontfix](https://forum.shopware.com/u/wontfix)\
**Post date:** [16. Juli 2018 um 10:35 UTC](https://forum.shopware.com/t/shopware-plugins-mit-phan-prufen/54090/1 "2018-07-16T10:35:20Z")

</div>

wir sind dabei unsere shops auf php7.0 zu aktualisieren, und dafür gehe ich unsere plugins mit [GitHub - phan/phan: Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.](https://github.com/phan/phan) durch. hab in ersten plugin gleich 2 „fehler“ finden und fixen können, yay!

hier meine `.phan/config.php` in shopware root ordner:

```
return [
        'target_php_verion' => '7.0',
        'directory_list' => [
                "custom/plugins/FooBar",
                "engine",
                "vendor"
        ],
         "exclude_analysis_directory_list" => [
                "engine",
                "vendor"
        ],
        'plugins' => [
                "$_SERVER[HOME]/phan/vendor/drenso/phan-extensions/Plugin/Annotation/SymfonyAnnotationPlugin.php"
        ],
];

```

und um phan extern zu halten, habe ich `~/phan/composer.json`:

```
{
    "require": {
        "phan/phan": "^0.12.14",
        "drenso/phan-extensions": "^2.3"
    }
}

```

_(nach erstellen `composer install` in `~/phan/` ausführen)_

und dann einfach die gewünschte plugin in `.phan/config.php` ändern und `~/phan/vendor/bin/phan` in shopware root ordner ausführen.

_ps. falls dein developer kiste debian 9 ist, ist die php extension ast paket zu alt für phan, daher muss man es manuell installieren [GitHub - nikic/php-ast: Extension exposing PHP 7 abstract syntax tree](https://github.com/nikic/php-ast#installation) (man braucht noch die paket `php-dev` dafür)_
