Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Avoid php deprecation in FrameworkState (7) #484

Merged
merged 1 commit into from
Aug 2, 2023
Merged

[TASK] Avoid php deprecation in FrameworkState (7) #484

merged 1 commit into from
Aug 2, 2023

Conversation

sbuerk
Copy link
Collaborator

@sbuerk sbuerk commented Aug 2, 2023

With PHP8.3 the ReflectionProperty->setValue() method
emits a E_DEPRECATED if a value should be set to a class
and the context is not set as first argument.

For instanciated classes the class needs to be provided,
which is not possible for a static class or property.

The solution for this is to use null as first argument
as context object. That avoids the deprecation and keeps
the backward compatibility.

The testing-framework provides a tool to keep and handle
static Framework state, which uses reflection under the
hood and therefore needs the null context for setValue().

Releases: main, 7, 6

With PHP8.3 the `ReflectionProperty->setValue()` method
emits a E_DEPRECATED if a value should be set to a class
and the context is not set as first argument.

For instanciated classes the class needs to be provided,
which is not possible for a static class or property.

The solution for this is to use `null` as first argument
as context object. That avoids the deprecation and keeps
the backward compatibility.

The testing-framework provides a tool to keep and handle
static Framework state, which uses reflection under the
hood and therefore needs the null context for `setValue()`.

Releases: main, 7, 6
@sbuerk sbuerk changed the title [TASK] Avoid php deprecation in FrameworkState [TASK] Avoid php deprecation in FrameworkState (7) Aug 2, 2023
@sbuerk sbuerk added the backport label Aug 2, 2023
@sbuerk sbuerk merged commit 258b9fc into 7 Aug 2, 2023
8 checks passed
@sbuerk sbuerk deleted the 7-stefan-1 branch August 2, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants