[Fix] Resolve PHP8.5 deprecation warnings#1118
Merged
RichardAnderson merged 1 commit intoMay 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 returnsarray_merge($previousOutputs, $resolvedInputs), so explicit action inputs (likeserver_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}"',
saeedvaziry
approved these changes
May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.