Skip to content

Add PHPDoc blocks to all functions - #396

Merged
TheWitness merged 2 commits into
developfrom
docs/phpdoc-blocks
Sep 24, 2026
Merged

TheWitness merged 2 commits into
developfrom
docs/phpdoc-blocks

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Summary

Adds PHPDoc blocks (description + purpose/invocation-context sentence,
@param, @return, and applicable @global tags) to every PHP
function 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 all panellib/*.php panel 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 PHP
functions.

Validation

  • php -l passed on every modified file.
  • Verified the count of documented functions matches the count of real
    PHP function definitions in each file (JS-only matches excluded).

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Low severity

Open (17)
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.

Comment thread display.php Outdated
Comment thread include/functions.php Outdated
Comment thread panellib/alert.php Outdated
Comment thread panellib/analyze.php Outdated
Comment thread panellib/busiest.php Outdated
Comment thread panellib/system.php Outdated
Comment thread panellib/thold.php Outdated
Comment thread panellib/thold.php Outdated
Comment thread panellib/top5.php Outdated
Comment thread poller_intropage.php Outdated
- 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/)
@TheWitness
TheWitness merged commit 620c470 into develop Sep 24, 2026
5 checks passed
@TheWitness
TheWitness deleted the docs/phpdoc-blocks branch September 25, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants