Deprecated Attribute

February 21, 2024 ยท View on GitHub

This attribute is the equivalent of the @deprecated annotation for classes, traits, interfaces, class properties, class methods, class constants and functions.

Arguments

The attribute accepts no arguments.

Example usage

<?php

use PhpStaticAnalysis\Attributes\Deprecated;

#[Deprecated] // Use NotDeprecatedClass instead
class DeprecatedExample
{
    #[Deprecated]
    public function getName(): string;
    
    ...
}