-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Moving dynamic properties into the private additionalProperties array breaks some existing application code #318
Comments
Thanks for the detailed summary. I guess we have a few choices.
@s0600204: what do you think? |
I'm a little lost, frankly. I don't see the problem that room34 is having, nor what he means to "use the For instance, using php 8.2.3 and the latest release of the ics-parser, I can run...
...and get sensible output when run with an ics file with But then that's to be expected: the At no point would I expect the I will note one change in behaviour that may not be desired: previously, a user could use either Now, both return However, if a magic |
Ah, thanks for this clarification… I think you've hit on what was my real issue (and I'm not quite sure how I didn't put it together before). I was using Suffice to say, this is an example of why I'm not submitting pull requests. I have my head a bit too buried in my own code to be able to contribute productively to this project. |
Thanks @s0600204 Todo:
|
8.2
America/Chicago
3.2.1
Description of the Issue:
This pertains to issue #316, which moved all dynamic properties of the
Event
object into the privateadditionalProperties
array to resolve deprecation notices in PHP 8.2.Throughout my application I have always liberally accessed
Event
properties directly, e.g.$event->attach_array
, because that approach is used several times in the documentation, and there was not, to my knowledge, a preferred getter method.Many of these properties apparently were being dynamically defined, which creates deprecation notices in PHP 8.2. So the solution in #316 was to move them into a defined
additionalProperties
array, and access them using the magic__get()
method.So far so good, but this resulted in a handful of mysterious "disappearances" of data for some of my users, and the resolution requires scouring my code for any instances of a property that might be dynamically defined, and changing those to use the
__get()
method instead. (Does__get()
also work for the defined properties? I suppose it does, but I haven't tested it, because I'm just putting out fires right now.)Apparently this situation could have been avoided, as it's possible to configure a class to allow dynamic properties, eliminating the deprecation notices in PHP 8.2:
https://php.watch/versions/8.2/dynamic-properties-deprecated#AllowDynamicProperties
I am not specifically requesting a change to this, as I have already made most if not all of the necessary changes in my code. I just wanted to bring this issue to contributors' attention.
Steps to Reproduce:
N/A
The text was updated successfully, but these errors were encountered: