4 Commits
Author SHA1 Message Date
Thomas VincentandTheWitness 11fa109548 refactor: safe PHP 7.4 modernization (#212)
* refactor: add strict typing and clean up standalone infra

* refactor: safe PHP 7.4 modernization (arrays, null coalescing)

* fix: restore corrupted function calls from refactor tool

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>

* fix: restore corrupted syntax from refactor tool

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix: remove duplicate declare(strict_types) statements

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix(security): escape request reuse in monitor views

* fix:Run php-cs-fixit to resolve workflows

* fix: Remove strict types for now

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Co-authored-by: TheWitness <thewitness@cacti.net>
2026-07-09 09:20:25 -04:00
Petr Macek ba4790ce7b fix typo (#216) 2026-05-06 08:17:55 -04:00
Petr Macek cad37ba0ec return back php 7.4 (#215)
* return back php 7.4

* fixer
2026-05-05 15:40:22 -04:00
501622a676 Refactor codebase for PSR12 compliance and modernization (#202)
* PSR12 - First run

Rename functions to match PSR12 requirements

* PSR12 run 1

- Change tabs to spaces
- add consts

* reduce cognetive complexity scores based on PSR12 and sonar scans

* Split poller_monitor  with helper file

* update docblocks

* code reorginization

Breaking up  some of the large files

* modernize js

Replaced legacy var with const/let.
Switched loose checks to strict (===, !==, strict typeof checks).
Added default param: applyFilter(action = '').
Used template literals for URL/query string assembly.
Converted many callbacks to arrow functions and shorthand methods.
Removed one duplicate object key in saveFilter payload (trim was defined twice with same value).
Kept existing flow, DOM selectors, action names, and endpoints unchanged.

* Update monitor.js

Applied the Sonar-requested cleanups in monitor.js:

* remove unused variables

* remove unused variables

* Update copilot-instructions.md

* PSR12 formatting

* Update db_functions.php

* refactor functions

Refactor rending function and Ajax call functions
Lowe cognetive complexity
prepare for easier testing

* Add missing docblocks

* Apply typing

* remove checks for min php version

* correct installation errors after PSR12

* try iinstall fix one more time

* .

* Update monitor_controller.php

* Update monitor_controller.php

* Update monitor_render.php

* fix typing errors

* apply php cs-fixer updates

* missed 2 commits

* Update js/monitor.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update js/monitor.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update copilot-instructions.md

---------

Co-authored-by: TheWitness <thewitness@cacti.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-07 11:55:27 -05:00