Add PHPDoc blocks to all functions - #396
Merged
Merged
Conversation
Add PHPDoc blocks (description, @PARAM, @return, and applicable @global tags) to every function definition across this plugin's PHP files: display.php, poller_intropage.php, setup.php, include/database.php, include/tab.php, include/settings.php, include/functions.php, and all panellib/*.php panel modules. No functional changes; documentation only. Validated with php -l.
TheWitness
requested review from
bmfmancini and
xmacan
and
a lite review from Copilot
September 24, 2026 10:46
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Several PHPDoc return, global-variable, and platform descriptions are inaccurate and should be corrected.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 17
Open (17)
Document display_information() boolean return type · New Document bytes formatter's string|int return type · New Document callback's returned panel array · New Document callback's returned panel array · New Document callback's bool|null return type · New Document callback's returned panel array · New Document callback's returned panel array · New Document callback's returned panel array · New Document callback's returned panel array · New Document callback's returned panel array · New Document callback's returned panel array · New Document the actual 48-hour trend view · New Document callback's returned panel array · New Document callback's returned panel array · New Document callback's returned panel array · New Document callback's returned panel array · New Document checks as the processed panel count · New
What changed in this PR
Adds PHPDoc blocks to PHP functions across the Intropage plugin, with no intended runtime changes.
Changes:
- Documents hooks, helpers, panel callbacks, database operations, and UI functions.
- Adds parameter, return, global, and invocation-context descriptions.
- Corrects inaccurate return and global-variable documentation before approval.
| File | Description |
|---|---|
setup.php |
Documents plugin lifecycle and panel APIs. |
poller_intropage.php |
Documents poller helpers and statistics gathering. |
panellib/top5.php |
Documents top-five panels. |
panellib/thold.php |
Documents Thold panels. |
panellib/system.php |
Documents system panels. |
panellib/syslog.php |
Documents Syslog panels. |
panellib/poller.php |
Documents poller panels. |
panellib/misc.php |
Documents miscellaneous panels. |
panellib/mactrack.php |
Documents MacTrack panels. |
panellib/graphs.php |
Documents graph panels. |
panellib/busiest.php |
Documents busiest-device panels. |
panellib/analyze.php |
Documents analysis panels. |
panellib/alert.php |
Documents alert panels. |
include/tab.php |
Documents header-tab integration. |
include/settings.php |
Documents settings and user administration hooks. |
include/functions.php |
Documents core dashboard utilities. |
include/database.php |
Documents schema setup and upgrades. |
display.php |
Documents dashboard rendering. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Fix display_information() return type (bool, not void) - Fix human_readable() return type (string|int for zero-value branch) - Fix alert_host_detail() and all other *_detail() panel callbacks across analyze.php, busiest.php, graphs.php, mactrack.php, misc.php, syslog.php, system.php, thold.php, top5.php: these return the $panel array, not void - Fix busiest_cpu/load/hdd/traffic/interface_error/interface_util() return type (bool|null, matching the early-return-true-on-disabled-DS-stats path) - Fix extrem_detail() description to say 48-hour (not 24-hour), matching the actual "interval 2 day" query and panel name - Fix intropage_gather_stats() @global $checks description (it is reset, incremented per panel, and returned in the summary - not unused) - Regenerate locales/po/cacti.pot (source line references only) - Fix .gitignore pattern for compiled .mo files (locales/LC_MESSAGES/, not locales/po/)
xmacan
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds PHPDoc blocks (description + purpose/invocation-context sentence,
@param,@return, and applicable@globaltags) to every PHPfunction definition in this plugin. Documentation only — no functional
changes.
Files covered:
display.php,poller_intropage.php,setup.php,include/database.php,include/tab.php,include/settings.php,include/functions.php, and allpanellib/*.phppanel modules(alert, analyze, busiest, graphs, mactrack, misc, poller, syslog,
system, thold, top5).
Embedded JavaScript functions (e.g.
selectAllPerms()inside<script>blocks) were identified and excluded, since they are not PHPfunctions.
Validation
php -lpassed on every modified file.PHP function definitions in each file (JS-only matches excluded).