/var/www/html/back/app/Attributes/OpenApiNotFoundResponse.php
<?php

declare(strict_types=1);

namespace App\Attributes;

use AllowDynamicProperties;
use App\Responses\Shared\Dto;
use App\Services\Shared\ResponseService;
use Attribute;
use Knuckles\Scribe\Attributes\Response as ResponseAttribute;

#[AllowDynamicProperties]
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_FUNCTION | Attribute::TARGET_METHOD | Attribute::TARGET_CLASS)]
class OpenApiNotFoundResponse extends ResponseAttribute
{
    public function __construct(
        public ?string $class,
    ) {

    }

    public function toArray(): array
    {
        return [
            'status' => 404,
            'content' => ResponseService::array(Dto::notFound($this->class)),
            'description' => 'Not Found',
        ];
    }
}