-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Adding dynamic properties by Registrars will be deprecated on PHP 8.2 #6162
Comments
#[AllowDynamicProperties] |
The issue is we will continue to use Dynamic Properties that PHP will denies by default or not. |
Why not use the Entity::$attributes case? |
What do you mean? |
I don't know the needs to add properties dynamically to Config objects. We can override config properties by Registrars now. What's missing? |
That is, all properties not previously defined should be placed in a separate container, which will have access through magic methods. I'm just suggesting solutions to the problem in 8.2. This does not mean that I agree with the use of dynamic properties. |
@iRedds Okay, thanks for explanation. It is an option. It seems there are three options.
I think 3. is simple and preferable. I did not know that Registrars can add dynamic properties. |
See #6172 (comment) |
I do not know what to say. CodeIgniter4/system/Database/BaseConnection.php Lines 336 to 340 in 053d669
But the tests/_support/Config/Registrar.php class does not define a new property in the database configuration class. |
We do not recommend the use of dynamic properties in Registrar. |
Registrars can add dynamic properties now.
But the sample code in the user guide will cause the error on PHP 8.2.
https://codeigniter4.github.io/CodeIgniter4/general/configuration.html#explicit-registrars
References:
The text was updated successfully, but these errors were encountered: