File manager - Edit - /var/www/html/back/app/Http/Controllers/OpenApiExceptionsResponse.php
Back
<?php declare(strict_types=1); namespace App\Attributes; use AllowDynamicProperties; use App\Responses\Shared\Dto; use Attribute; use Knuckles\Scribe\Attributes\Response as ResponseAttribute; #[AllowDynamicProperties] #[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_FUNCTION | Attribute::TARGET_METHOD | Attribute::TARGET_CLASS)] class OpenApiExceptionsResponse extends ResponseAttribute { public function __construct( public string $class, public string $method, ) { } public function toArray(): array { $exceptions = Dto::getMethodExceptions($this->class, $this->method); $a = collect($exceptions)->map(function ($exception) { $u = 'App\\Exceptions\\' . $exception; $s = new $u(); return [ 'status' => $s->json()->getStatusCode(), 'content' => $s->json()->getContent(), 'description' => $exception, ]; })->toArray(); return $a[1]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0.16 |
proxy
|
phpinfo
|
Settings