Skip to content

Commit

Permalink
php 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaOnLine committed Feb 12, 2025
1 parent e7485ff commit 2dc163a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/ConfigFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class ConfigFactory
/**
* Retrieves and merges the configuration for the specified documentation.
*
* @param string|null $documentation The name of the documentation configuration to retrieve. If null, the default documentation configuration is used.
* @param string|null $documentation The name of the documentation configuration to retrieve.
* If null, the default documentation configuration is used.
* @return array The merged configuration for the specified documentation.
*
* @throws L5SwaggerException If the specified documentation configuration is not found.
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Controllers/SwaggerAssetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class SwaggerAssetController extends BaseController
* Serves a specific documentation asset for the Swagger UI interface.
*
* @param Request $request The incoming HTTP request, which includes parameters to locate the requested asset.
* @return Response The HTTP response containing the requested asset content or a 404 error if the asset is not found.
* @return Response The HTTP response containing the requested asset content
* or a 404 error if the asset is not found.
*
* @throws FileNotFoundException
*/
Expand Down
7 changes: 4 additions & 3 deletions src/Http/Controllers/SwaggerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace L5Swagger\Http\Controllers;

use Exception;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Http\Request;
Expand All @@ -27,8 +28,8 @@ public function __construct(
* @param Request $request The HTTP request containing parameters such as documentation and configuration.
* @return Response The HTTP response containing the documentation file content with appropriate headers.
*
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException If the documentation file does not exist.
* @throws \Exception If the documentation generation process fails.
* @throws FileNotFoundException If the documentation file does not exist.
* @throws Exception If the documentation generation process fails.
*/
public function docs(Request $request): Response
{
Expand All @@ -50,7 +51,7 @@ public function docs(Request $request): Response

try {
$generator->generateDocs();
} catch (\Exception $e) {
} catch (Exception $e) {
Log::error($e);

abort(
Expand Down
10 changes: 5 additions & 5 deletions src/SecurityDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Collection;

class SecurityDefinitions
readonly class SecurityDefinitions
{
public function __construct(
private readonly array $securitySchemesConfig = [],
private readonly array $securityConfig = []
private array $schemasConfig = [],
private array $securityConfig = []
) {
}

Expand All @@ -29,8 +29,8 @@ public function generate(string $filename): void
json_decode($fileSystem->get($filename))
);

if (is_array($this->securitySchemesConfig) && ! empty($this->securitySchemesConfig)) {
$documentation = $this->injectSecuritySchemes($documentation, $this->securitySchemesConfig);
if (is_array($this->schemasConfig) && ! empty($this->schemasConfig)) {
$documentation = $this->injectSecuritySchemes($documentation, $this->schemasConfig);
}

if (is_array($this->securityConfig) && ! empty($this->securityConfig)) {
Expand Down

0 comments on commit 2dc163a

Please sign in to comment.