File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ jobs:
187187 exit 1
188188 fi
189189
190+
190191 - name : Run Cacti Poller
191192 run : |
192193 cd ${{ github.workspace }}/cacti
@@ -232,3 +233,39 @@ jobs:
232233 echo "=== Cacti Log ==="
233234 sudo cat ${{ github.workspace }}/cacti/log/cacti.log
234235 fi
236+
237+
238+ - name : Create PHPStan config
239+ run : |
240+ cd ${{ github.workspace }}/cacti/plugins/syslog
241+ cat > phpstan.neon << 'EOF'
242+ parameters:
243+ level: 5
244+ paths:
245+ - .
246+ excludePaths:
247+ - vendor/
248+ - locales/
249+ ignoreErrors:
250+ - '#Function db_[a-z_]+ not found\.#'
251+ - '#Function cacti_[a-z_]+ not found\.#'
252+ - '#has invalid return type the\.#'
253+ - '#Class [a-zA-Z_\\]+ not found\.#'
254+ bootstrapFiles:
255+ - ../../include/global.php
256+ EOF
257+
258+ - name : Install PHPStan
259+ run : |
260+ cd ${{ github.workspace }}/cacti/plugins/syslog
261+ composer require --dev phpstan/phpstan --with-all-dependencies || composer global require phpstan/phpstan
262+
263+ - name : Run PHPStan Analysis
264+ run : |
265+ cd ${{ github.workspace }}/cacti/plugins/syslog
266+ if [ -f vendor/bin/phpstan ]; then
267+ vendor/bin/phpstan analyse --no-progress --error-format=github || true
268+ else
269+ phpstan analyse --no-progress --error-format=github || true
270+ fi
271+ continue-on-error : true
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments