diff --git a/.github/agents/php-developer.agent.md b/.github/agents/php-developer.agent.md index 4153ea3..9174c9d 100644 --- a/.github/agents/php-developer.agent.md +++ b/.github/agents/php-developer.agent.md @@ -7,7 +7,7 @@ model: "Claude Sonnet 4.5" # PHP Developer You are a PHP Developer agent. Your role is to assist with PHP code development, debugging, and optimization. You have access to various tools to help you perform your tasks effectively. -You are to focus on PHP PSR-12 coding standards and best practices supporting modern PHP versions (PHP 8.1 and above). +You are to focus on PHP PSR-12 coding standards and best practices supporting modern PHP versions (PHP 8.2 and above). Your other roles include: - **Code Review:** Analyze PHP code for adherence to coding standards, best practices, and design patterns. - **Debugging:** Identify and resolve bugs or issues in PHP code. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 040ae03..7e31947 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -13,7 +13,7 @@ When generating code for this repository: ## Technology Stack ### Core Technologies -- **PHP**: 8.1+ (CI matrix tests 8.1-8.4) +- **PHP**: 8.2+ (CI matrix tests 8.2-8.4) - **Platform**: Cacti Plugin Architecture (Cacti 1.2.15+) - **Database**: MariaDB 10.6+ with InnoDB engine - **Dependency**: Requires the `thold` plugin (>= 1.2.1) to be installed diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index 35bb2c6..b858db2 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -80,6 +80,7 @@ jobs: with: php-version: ${{ matrix.php }} extensions: intl, mysql, gd, ldap, gmp, xml, curl, json, mbstring, snmp + coverage: pcov ini-values: "post_max_size=256M, max_execution_time=60, date.timezone=America/New_York" - name: Check PHP version diff --git a/docs/architecture/0001-hexagonal-monitor.md b/docs/architecture/0001-hexagonal-monitor.md index d1ffb62..99c0759 100644 --- a/docs/architecture/0001-hexagonal-monitor.md +++ b/docs/architecture/0001-hexagonal-monitor.md @@ -35,7 +35,7 @@ The target contains the following responsibilities: poller hook, and the existing Monitor web UI. Domain code must not access request variables, sessions, globals, SQL, the -filesystem, or Cacti helper functions. New code targets PHP 8.1, the +filesystem, or Cacti helper functions. New code targets PHP 8.2, the baseline this repository's CI tests against. ## State and delivery rules diff --git a/tests/bootstrap-unit.php b/tests/bootstrap-unit.php index c599982..e8a5cd1 100644 --- a/tests/bootstrap-unit.php +++ b/tests/bootstrap-unit.php @@ -254,10 +254,9 @@ function test_set_request(array $vars): void { $GLOBALS['__test_request'] = $vars; } -if (!function_exists('validateRequestVars')) { - function validateRequestVars($section, $filter = array()) { - } -} +// validateRequestVars() is not stubbed here: monitor_controller.php declares +// it unconditionally, so a global stub would fatal with a redeclare error +// once a test loads that file via loadPluginSource()/monitor_test_load(). if (!function_exists('form_input_validate')) { function form_input_validate($value, $name, $regex, $optional, $error) {