Skip to content

Add PHPDoc blocks to remaining undocumented functions - #271

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, @param, @return, and applicable @global/@throws tags) to functions that were missing them across this plugin.

Fully documented in this PR

  • database.php
  • flowview.php
  • flowview_bulkarin.php
  • flowview_cleanup.php
  • flowview_devices.php
  • flowview_drop_raw_tables.php
  • flowview_filters.php
  • flowview_process.php
  • flowview_runner.php
  • flowview_security.php
  • flowview_upgrade.php
  • functions-pre13.php
  • run_schedule.php

Excluded (vendored third-party code)

Net/DNS2.php and its full dependency tree (Net_DNS2 library by Mike Pultz, BSD-licensed) are excluded — that library already ships with its own complete PHPDoc coverage.

Remaining work (follow-up PR)

Given the size of this plugin, the following files still have undocumented functions and are tracked for a follow-up PR: flowview_databases.php, flowview_schedules.php, flow_collector.php, setup.php, and functions.php (the largest file, ~93 functions).

No functional changes — documentation only. All modified files validated with php -l.

Add PHPDoc blocks (description, @PARAM, @return, and applicable
@global tags) to functions that lacked them, across a codebase that
already had substantial partial PHPDoc coverage from prior work
(notably the vendored Net_DNS2 library files, which are correctly
excluded as third-party code - see Net/ and its dependents).

Fully completed in this PR: database.php, flowview.php,
flowview_bulkarin.php, flowview_cleanup.php, flowview_devices.php,
flowview_drop_raw_tables.php, flowview_filters.php, flowview_process.php,
flowview_runner.php, flowview_security.php, flowview_upgrade.php,
functions-pre13.php, run_schedule.php.

Remaining work (tracked as a follow-up PR): flowview_databases.php,
flowview_schedules.php, flow_collector.php, setup.php, and
functions.php still have undocumented functions and were not completed
in this pass given the scale of this plugin's codebase.

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

Unresolved moderate issues and inaccurate PHPDoc contracts remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 11 Low severity

Open (12)
What changed in this PR

Adds PHPDoc blocks to previously undocumented plugin functions without intended runtime changes.

Changes:

  • Documents database, UI, CLI, security, upgrade, and compatibility functions.
  • Adds parameter, return, and global annotations.
File Description
run_schedule.php Documents schedule CLI functions
functions-pre13.php Documents compatibility shims
flowview.php Documents filter and export functions
flowview_upgrade.php Documents upgrade operations
flowview_security.php Documents listener validation
flowview_runner.php Documents worker and signal functions
flowview_process.php Documents process CLI functions
flowview_filters.php Documents filter management functions
flowview_drop_raw_tables.php Documents CLI functions
flowview_devices.php Documents device management functions
flowview_cleanup.php Documents cleanup CLI functions
flowview_bulkarin.php Documents CLI help functions
database.php Documents database helpers

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread flowview_devices.php
Comment thread database.php Outdated
Comment thread database.php Outdated
Comment thread database.php
Comment thread flowview.php Outdated
Comment thread flowview_filters.php Outdated
Comment thread flowview_filters.php Outdated
Comment thread flowview_upgrade.php Outdated
Comment thread functions-pre13.php Outdated
Comment thread functions-pre13.php Outdated
- Fix export_template(): print the yaml_emit()'d data before exit()
  (the YAML download branch never printed anything) - genuine
  functional bug, not just a doc mismatch
- Add missing @PARAM variable names in database.php PHPDoc blocks
  (flowview_db_table_create/column_exists/add_column/affected_rows)
- Fix load_session_for_filter() return type (string, not void)
- Remove incorrect @global $flow_fieldids tag from edit_device()
  (only used by export_template())
- Fix @global $nesting_arr description in show_devices() (unused here)
- Fix @global $sched_actions description in actions_filters() (used
  for the confirmation box title)
- Fix @global $graph_timespans description in show_filters() (unused
  here)
- Fix @global $config description in flowview_upgrade() (used to
  locate irr_tables.php)
- Fix $oput_text param type (string|null) in
  reports_log_and_notify()
- Fix reports_run() return type (bool|null)
- 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 b44a32e into develop Sep 24, 2026
3 checks passed
@TheWitness
TheWitness deleted the docs/phpdoc-blocks branch September 25, 2026 01:34
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