Changes between Version 4 and Version 5 of Ticket #56034
- Timestamp:
- 06/22/2022 02:14:01 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #56034 – Description
v4 v5 112 112 1. Introduce two traits into WP Core: `trait DeprecateDynamicProperties` and `trait ForbidDynamicProperties`. 113 113 * The `DeprecateDynamicProperties` trait would contain a full set of the magic methods (`__isset()`, `__get()`, `__set()`, `__unset()` and will throw a deprecation notice whenever any of those methods are called. Properties will still be set via the magic methods. This trait is intended to be a temporary stop-gap solution and will not fall under the WordPress BC promise. When PHP removes support for dynamic properties, this trait should be removed from WordPress as well. 114 * The `ForbidDynamicProperties` trait would contain a full set of the magic methods (`__isset()`, `__get()`, `__set()`, `__unset()` and will throw eithera fatal error whenever the `__set()` method is called. Properties will **not** be set via the magic methods, `__isset()` will always return `false`, `__get()` will always result in an undefined property warning.114 * The `ForbidDynamicProperties` trait would contain a full set of the magic methods (`__isset()`, `__get()`, `__set()`, `__unset()` and will throw a fatal error whenever the `__set()` method is called. Properties will **not** be set via the magic methods, `__isset()` will always return `false`, `__get()` will always result in an undefined property warning. 115 115 2. Evaluate every single class in WP Core `src` directory: 116 116 * If the class - or one of its parents - already has a full set of properly implemented magic methods in place, no action is needed.