Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
gilour
/
back
/
app
/
Attributes
:
OpenApiResponse.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php declare(strict_types=1); namespace App\Attributes; use AllowDynamicProperties; use App\Responses\Dto; use App\Services\ResponseService; use Attribute; use Illuminate\Support\Str; use Knuckles\Scribe\Attributes\Response as ResponseAttribute; #[AllowDynamicProperties] #[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_FUNCTION | Attribute::TARGET_METHOD | Attribute::TARGET_CLASS)] class OpenApiResponse extends ResponseAttribute { public function __construct( /** @var Dto $dto */ public ?string $dto, public ?string $event = 'ok', public int $status = 200, ) { /*_*/ } public function toArray(): array { return [ 'status' => $this->status, 'content' => ResponseService::array($this->dto::example($this->event, $this->dto)), 'description' => Str::headline($this->event), ]; } }