Haehnchen / idea-php-annotation-plugin

Add PHP annotation support for PhpStorm and IntelliJ
https://plugins.jetbrains.com/plugin/7320
MIT License
251 stars 41 forks source link

Incorrect Doctrine deprecation flagged on OpenApi attributes #259

Closed mbabker closed 1 year ago

mbabker commented 1 year ago

In one of our projects, we are using https://github.com/zircote/swagger-php to document our API with their attribute classes.

Using this example minimal schema:

<?php

namespace App\Http\Resources\Reports;

use Illuminate\Http\Resources\Json\ResourceCollection;
use OpenApi\Attributes as OA;

#[OA\Schema(
    schema: 'example_report_list',
    type: 'object',
)]
final class ExampleReportResourceCollection extends ResourceCollection {}

In PhpStorm, the type property is being flagged with a deprecation notice based on a deprecation from the Doctrine ORM.

[Annotations] Deprecated: Use {@link JsonType} instead. 
Inspection info:
Reports deprecations of the type Doctrine\ORM\Mapping\Column::type based on the underlying type class

I'd suggest that this deprecation should only apply to Doctrine mapping annotations/attributes to avoid false positives.