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

Creation of dynamic property is deprecated. #3

Open
laurentmuller opened this issue Aug 28, 2024 · 0 comments
Open

Creation of dynamic property is deprecated. #3

laurentmuller opened this issue Aug 28, 2024 · 0 comments

Comments

@laurentmuller
Copy link

Your plugin is very good. Thank You !

I use it for tests with PHP 8.3 and PHPUnit 10.0.

When I run tests, a deprecation is raised as follow:

1x: Creation of dynamic property MockPhpStream::$context is deprecated
    2x in MyTest::testContent from App\Tests

I don't know where this issue comes from because the $context variable is not found in the class.

To work around, you can add the AllowDynamicProperties attribute to the class as follows:

#[AllowDynamicProperties]
class MockPhpStream
{
    //...
}

See PHP 8.2: Dynamic Properties are deprecated.

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

No branches or pull requests

1 participant