Inspectopedia
 
2024.3

Getter and setter can be replaced with get and set property hooks

Info
New
Last modified: 03 December 2024

Reports a private property with getter and/or setter access methods that can be replaced with a public property with get and/or set property hooks.

get and set property hooks are supported in PHP 8.4 and later. For details, see PHP RFC: Property hooks.