Skip to content

refactor: safe PHP 7.4 modernization#212

Open
somethingwithproof wants to merge 7 commits intoCacti:developfrom
somethingwithproof:refactor/modernization
Open

refactor: safe PHP 7.4 modernization#212
somethingwithproof wants to merge 7 commits intoCacti:developfrom
somethingwithproof:refactor/modernization

Conversation

@somethingwithproof
Copy link
Copy Markdown

This PR adds strict typing, short array syntax, and null coalescing operators across the plugin. Standalone infrastructure files were removed per architectural mandate.

Copilot AI review requested due to automatic review settings April 9, 2026 21:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to “modernize” the Monitor plugin by adding declare(strict_types=1); across many PHP entrypoints (including theme/sounds/locales directories) as part of a broader refactor.

Changes:

  • Added declare(strict_types=1); headers to many plugin PHP files (including redirect-only index.php files).
  • Introduced (unintentionally) multiple PHP parse/fatal errors (duplicate strict_types declarations, corrupted function name, corrupted in_array calls).
  • Added .omc/sessions/*.json artifacts to the repository.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
themes/sunrise/index.php Adds strict_types directive to theme directory index.
themes/paw/index.php Adds strict_types directive to theme directory index.
themes/paper-plane/index.php Adds strict_types directive to theme directory index.
themes/modern/index.php Adds strict_types directive to theme directory index.
themes/midwinter/index.php Adds strict_types directive to theme directory index.
themes/index.php Adds strict_types directive to themes index.
themes/dark/index.php Adds strict_types directive to theme directory index.
themes/classic/index.php Adds strict_types directive to theme directory index.
sounds/index.php Adds strict_types directive to sounds index.
setup.php Adds strict_types and contains a corrupted function declaration (parse error).
poller_monitor.php Adds strict_types but now has duplicate strict_types declarations (fatal error).
poller_functions.php Adds strict_types but now has duplicate strict_types declarations (fatal error).
monitor.php Adds strict_types but now has duplicate strict_types declarations (fatal error).
monitor_render.php Adds strict_types, duplicates strict_types, and corrupts in_array calls (parse errors).
monitor_controller.php Adds strict_types but now has duplicate strict_types declarations (fatal error).
locales/LC_MESSAGES/index.php Adds strict_types but now has duplicate strict_types declarations (fatal error).
locales/index.php Adds strict_types directive to locales index.
index.php Adds strict_types directive to plugin root index.
images/index.php Adds strict_types but now has duplicate strict_types declarations (fatal error).
db_functions.php Adds strict_types but now has duplicate strict_types declarations (fatal error).
.omc/sessions/a22869a1-89d7-4361-99da-c0e9ddd0c107.json Adds generated session artifact file (should not be committed).
.omc/sessions/a1a9193b-aae0-43d7-bd1f-726d20d95ee8.json Adds generated session artifact file (should not be committed).

Comment thread setup.php Outdated
Comment thread monitor_render.php Outdated
Comment thread poller_monitor.php
Comment thread poller_functions.php
Comment thread monitor.php
Comment thread db_functions.php
Comment thread images/index.php
Comment thread locales/LC_MESSAGES/index.php
Comment thread .omc/sessions/a22869a1-89d7-4361-99da-c0e9ddd0c107.json Outdated
Comment thread .omc/sessions/a1a9193b-aae0-43d7-bd1f-726d20d95ee8.json Outdated
Revert bulk array()->[] rewrite damage affecting:
- is_array, in_array, xml2array
- call_user_func_array, filter_var_array
- Function declarations with _array suffix

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
TheWitness
TheWitness previously approved these changes Apr 24, 2026
@TheWitness TheWitness self-requested a review April 24, 2026 14:27
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.

4 participants