Skip to content

MIR1005

DeprecatedProperty

A property annotated with @deprecated in its docblock is being read or written. Deprecated properties are scheduled for removal and should not be used in new code.

<?php
class User {
/**
* @deprecated Use $displayName instead.
*/
public string $username = '';
public string $displayName = '';
}
$user = new User();
echo $user->username; // deprecated property access

Switch to the replacement property or method indicated in the @deprecated message.