The VSCode extension that uses this package has been invaluable to me. I particularly like the feature that automatically removes unused packages. However, I've discovered it will remove imports used by attributes.
Steps to reproduce:
- Add an attribute to a class or function which requires an import
- Run the package with
php-imports.unused.enable set to true
- The import used by the attribute is removed.
Example:
<?php
namespace App\Http\Controllers;
use App\Http\Resources\CareerResource;
use App\Models\Career;
use Illuminate\Http\Request;
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
#[OpenApi\PathItem] // This attribute uses the OpenApi import above.
class CareerController extends Controller
{
/**
* Display a listing of the resource.
*/
#[OpenApi\Operation] // This attribute also uses the OpenApi import above.
public function index()
{
return Career->get();
}
}
In this example, the use Vyuldashev\LaravelOpenApi\Attributes as OpenApi; is removed, even though it is necessary by those attributes.
The VSCode extension that uses this package has been invaluable to me. I particularly like the feature that automatically removes unused packages. However, I've discovered it will remove imports used by attributes.
Steps to reproduce:
php-imports.unused.enableset to trueExample:
In this example, the
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;is removed, even though it is necessary by those attributes.