Skip to content

Commit

Permalink
Add phan flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Oct 20, 2023
1 parent 60fa585 commit 633b814
Show file tree
Hide file tree
Showing 73 changed files with 12,000 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/phan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
on: [pull_request, push]
name: phan
jobs:
phan:
name: Run phan
runs-on: ubuntu-latest
container:
image: phanphp/phan:latest
steps:
- name: Link paths
shell: sh
run: |
ln -s $GITHUB_WORKSPACE /mnt/src
apk add git
- name: Checkout
uses: actions/checkout@v4

- name: Run Phan
run: |
cd /mnt/src
set -o pipefail
/opt/phan/phan --quick -k .phan/config.php -B .phan/baseline.txt --analyze-twice --minimum-target-php-version 5.6 | tee phan.log
- name: Provide phan log as artifact
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: phan-srcrt
path: ${{ github.workspace }}/phan.log
retention-days: 5
70 changes: 70 additions & 0 deletions .phan/baseline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
/**
* This is an automatically generated baseline for Phan issues.
* When Phan is invoked with --load-baseline=path/to/baseline.php,
* The pre-existing issues listed in this file won't be emitted.
*
* This file can be updated by invoking Phan with --save-baseline=path/to/baseline.php
* (can be combined with --load-baseline)
*/
return [
// # Issue statistics:

// Currently, file_suppressions and directory_suppressions are the only supported suppressions
'file_suppressions' => [
'htdocs/core/lib/functions.lib.php' => ['PhanPluginDuplicateArrayKey',],
'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredVariable',],
'htdocs\debugbar\class\DataCollector\DolPhpCollector.php' => ['PhanPowerOfZero',],
'htdocs/public/payment/newpayment.php' => ['PhanUndeclaredClassCatch',],
'htdocs/stripe/class/stripe.class.php' => ['PhanUndeclaredClassCatch',],
'htdocs/core/class/dolgeoip.class.php' => ['PhanUndeclaredFunction',],
'htdocs/bom/tpl/objectline_create.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/bom/tpl/objectline_edit.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/bom/tpl/objectline_view.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/core/commonfieldsinexport.inc.php'=>['PhanUndeclaredThis',],
'htdocs/core/commonfieldsinimport.inc.php'=>['PhanUndeclaredThis',],
'htdocs/core/extrafieldsinexport.inc.php'=>['PhanUndeclaredThis',],
'htdocs/core/extrafieldsinimport.inc.php'=>['PhanUndeclaredThis',],
'htdocs/core/tpl/objectline_create.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/core/tpl/objectline_edit.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/core/tpl/objectline_title.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/core/tpl/objectline_view.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/core/tpl/originproductline.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/hrm/core/tpl/objectline_view.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/mrp/tpl/originproductline.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/variants/tpl/productattributevalueline_create.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/variants/tpl/productattributevalueline_view.tpl.php'=>['PhanUndeclaredThis',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page179.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page180.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page181.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page182.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page183.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page184.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page185.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page186.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page187.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page188.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page189.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page190.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page191.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page192.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page193.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page194.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-corporate/containers/page195.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/page202.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/styles.css.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-noimg/containers/page80.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/page148.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/styles.css.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-restaurant/containers/page248.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-restaurant/containers/page249.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-restaurant/containers/page252.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-restaurant/containers/page253.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-restaurant/containers/styles.css.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-stellar/containers/page20.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-stellar/containers/page22.tpl.php'=>['PhanPluginWhitespaceTrailing',],
'htdocs/install/doctemplates/websites/website_template-stellar/containers/styles.css.php'=>['PhanPluginWhitespaceTrailing',],
],
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.
// (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases)
];
Loading

0 comments on commit 633b814

Please sign in to comment.