dolibarr/dev/tools/phan
MDW da9fd874bc
Qual: Fix or ignore functions.lib.php phan notices (#29344)
* Fix: LogHandler parent class, implements interface & provides $code

* Fix: functions.lib phan notices

* Fix phan notifications

* Match expected DebugBar signature - rename getRenderer

* Call the correct renderer method for the DebugBar

* Use correct key type to access array

* Ignore notices

* Update functions.lib.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-04-14 04:46:33 +02:00
..
plugins Fix phan tool for shipping 2024-03-12 11:21:42 +01:00
stubs Qual: Enable Phan Rules and update baseline (#29255) 2024-04-07 11:55:39 +02:00
.gitignore QUAL Use phan to help detect new issues (#27706) 2024-02-21 18:14:29 +01:00
baseline_extended.txt Qual: Phan/apstats should not be using the standard baseline (#29267) 2024-04-07 15:02:00 +02:00
baseline.txt Qual: Fix or ignore functions.lib.php phan notices (#29344) 2024-04-14 04:46:33 +02:00
config_extended.php Exclude PhanDeprecatedProperty for the moment 2024-04-05 10:22:01 +02:00
config_fixer.php Add checks on dol_(mktime|now|print_date) + avoid duplicate phan conf 2024-03-27 10:18:39 +01:00
config.php Qual: Enable Phan Rules and update baseline (#29255) 2024-04-07 11:55:39 +02:00
PHAN.BAT Qual: Enable detection of deprecated modulename & GETPOST(...,'int') (#28457) 2024-02-28 23:25:16 +01:00
README.md QUAL Use phan to help detect new issues (#27706) 2024-02-21 18:14:29 +01:00
run-phan.sh QUAL Use phan to help detect new issues (#27706) 2024-02-21 18:14:29 +01:00
runPhanDocker.sh QUAL Use phan to help detect new issues (#27706) 2024-02-21 18:14:29 +01:00

Static Code Checks using phan

Installation, running

run-phan.sh can install and run phan.

See instructions in run-phan.sh for installing (or just run it).

The configuration file in PROJECT_DIR/.phan/config.php also allows you to run phan independently from the script.

Run options:

No option : Runs the minimum checks

Option 'full' : Runs all an extensive set of checks

Option '1' : Writes the baseline

Examples:

  • run-phan.sh runs the default checks
  • run-phan.sh 1 updates the baseline for the default checks
  • run-phan.sh full runs the extended checks
  • run-phan.sh full 1 updates the baseline for the extended checks

Baseline

The baseline.txt file in this directory defines the issues that are currently excluded from the final report. In principle you should not add any more exceptions to that file, but rather fix the issues or add phan annotations that provide more information or to exclude specific cases.

Configuration

config.php : Default configuration file

config_extended.php : Configuration that enables more checks.

baseline.txt : Ignored issues (with config.php)

baseline_extended.txt : Ignored issues (with config_extended.php), not currently in git