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. 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 (man braucht noch die paket php-dev
dafür)