Skip to content

[Fix] Resolve PHP8.5 deprecation warnings#1118

Merged
RichardAnderson merged 1 commit into
vitodeploy:4.xfrom
RichardAnderson:fix/php85-deprecations
May 23, 2026
Merged

[Fix] Resolve PHP8.5 deprecation warnings#1118
RichardAnderson merged 1 commit into
vitodeploy:4.xfrom
RichardAnderson:fix/php85-deprecations

Conversation

@RichardAnderson

Copy link
Copy Markdown
Member

This pull request removes unnecessary calls to setAccessible(true) when using PHP's Reflection API in various test files. This method has been removed in 8.5 and has been deprecated since 8.1, so throws warnings when we run unit tests against 8.5.

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.

Pull request overview

This PR updates the test suite to be compatible with PHP 8.5 by removing deprecated/removed ReflectionMethod::setAccessible(true) / ReflectionProperty::setAccessible(true) calls, avoiding deprecation warnings (and future failures) when running tests on newer PHP versions.

Changes:

  • Removed setAccessible(true) calls from Reflection usage in multiple tests.
  • Cleaned up a now-redundant comment in the workflow input resolution test.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/Unit/Plugins/LegacyPluginsTest.php Removes setAccessible(true) before invoking reflected methods to avoid PHP 8.5 deprecations.
tests/Unit/Models/ServerModelTest.php Removes setAccessible(true) on a reflected property before setting its value in a test.
tests/Feature/WorkflowInputResolutionTest.php Removes setAccessible(true) calls when invoking a reflected private method (and drops a redundant comment).
Comments suppressed due to low confidence (1)

tests/Feature/WorkflowInputResolutionTest.php:226

  • The inline comments in this test are misleading: resolveInputs() intentionally returns array_merge($previousOutputs, $resolvedInputs), so explicit action inputs (like server_id => 999) take priority in the merged result, while string interpolation uses the original $previousOutputs. Consider updating the comments to reflect that nuance to avoid confusion when maintaining these tests.
        $previousOutputs = [
            'server_id' => 123, // This should take priority
            'server_ip' => '192.168.1.100',
        ];

        $actionInputs = [
            'server_id' => 999, // This should be overridden
            'command' => 'echo "Using server {server_id}"',

@RichardAnderson RichardAnderson merged commit 4ffbe95 into vitodeploy:4.x May 23, 2026
3 checks passed
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