Skip to content

[Bug]: Deprecated annotation is not getting parsed #1220

Description

@dmohns

What happened?

Using a deprecated attribute instead of deprecated annotation doesn't seem to work. For example enabling the following Rector rule https://getrector.com/rule-detail/deprecated-annotation-to-deprecated-attribute-rector would remove all deprecated tags from all endpoints.

How to reproduce the bug

Consider the following controller

class JobController extends Controller
{
    /**
     * Create job.
     */
    #[\Deprecated(message: 'Use SomeOtherFunction instead', since: '1.0.0')]
    public function store(Company $company, JobPayloadData $jobPayload)
    {
        $job = Job::make($jobPayload);

        $company->jobs()->save($job);

        return JobData::from($job);
    }
}

yields

Image

However, changing to @deprecated annotation works

    /**
     * Create job.
     *
     * @deprecated 1.0.0 Use SomeOtherFunction instead
     */
    public function store(Company $company, JobPayloadData $jobPayload)
Image

Package Version

v0.13.32

PHP Version

8.3

Laravel Version

v13.19.0

Which operating systems does with happen with?

macOS

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions