You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Establish one enforceable PHP standard for MacTrack 1.3 while modernizing legacy code incrementally and without repository-wide formatting churn.
Required baseline
Require PHP >=8.3 in Composer and test the supported PHP range in CI.
Use PER Coding Style 3.x for new namespaced code under src/ and for files deliberately migrated to the modern architecture.
Keep Cacti coding style for small edits to unmigrated legacy files; perform formatting-only migrations separately from behavior changes.
Use PSR-4 autoloading with Cacti\Mactrack\ mapped to src/.
Add declare(strict_types=1) to every new PHP file and to legacy files as they are migrated.
Prefer native parameter, property, and return types. Reserve PHPDoc for generics, array shapes, contracts, and behavior the type system cannot express.
Use one committed automatic formatting configuration and enforce it in CI.
Reach PHPStan level 8 with zero new findings. The baseline may shrink but must not grow.
Standardize on PHPStan after Psalm parity is confirmed; do not maintain two overlapping static-analysis policies indefinitely.
Require 100% line coverage for new application code and regression tests for every defect fixed.
Require Docker integration tests for scanners, SNMP behavior, database migrations, scheduled/poller execution, and dependency failure paths.
Manage dependencies only through Composer; commit the lock file and run composer validate --strict plus a clean composer install --no-dev test.
Use prepared SQL, context-appropriate output escaping, validated CLI input, structured exceptions, and fail-closed dependency handling.
Introduce a PSR-3-compatible MacTrack logging adapter backed by Cacti cacti_log() rather than coupling new services directly to globals.
Migration policy
Do not reformat the whole legacy plugin in one functional change. Apply the modern standard to src/, tests, and explicitly migrated files. This preserves useful blame history and avoids unnecessary conflicts with active maintenance branches.
Suggested order
Align Composer and CI on PHP 8.3.
Commit formatter/coding-standard configuration scoped to new and migrated code.
Goal
Establish one enforceable PHP standard for MacTrack 1.3 while modernizing legacy code incrementally and without repository-wide formatting churn.
Required baseline
>=8.3in Composer and test the supported PHP range in CI.src/and for files deliberately migrated to the modern architecture.Cacti\Mactrack\mapped tosrc/.declare(strict_types=1)to every new PHP file and to legacy files as they are migrated.composer validate --strictplus a cleancomposer install --no-devtest.cacti_log()rather than coupling new services directly to globals.Migration policy
Do not reformat the whole legacy plugin in one functional change. Apply the modern standard to
src/, tests, and explicitly migrated files. This preserves useful blame history and avoids unnecessary conflicts with active maintenance branches.Suggested order
Related work
Acceptance criteria
References